[Scummvm-git-logs] scummvm master -> 344fb2c2d594f1aa88bea9b625542d6ecdf9dc16

AndywinXp noreply at scummvm.org
Tue Mar 21 16:01:20 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
344fb2c2d5 SCUMM: FT: Fix crash with debug mode on when pressing 'A'


Commit: 344fb2c2d594f1aa88bea9b625542d6ecdf9dc16
    https://github.com/scummvm/scummvm/commit/344fb2c2d594f1aa88bea9b625542d6ecdf9dc16
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-03-21T17:01:09+01:00

Commit Message:
SCUMM: FT: Fix crash with debug mode on when pressing 'A'

Changed paths:
    engines/scumm/script_v6.cpp


diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 7a6ee4d4964..1347fd38566 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -1503,8 +1503,15 @@ void ScummEngine_v6::o6_getActorRoom() {
 		return;
 	}
 
-	Actor *a = derefActor(act, "o6_getActorRoom");
-	push(a->_room);
+	Actor *a = derefActorSafe(act, "o6_getActorRoom");
+	// This check is in place because at least Full Throttle, despite
+	// only allowing 30 actors, might ask for actor 30 (0-indexed), which
+	// on the original went on to fetch garbage data without crashing.
+	// In our case, instead of erroring out, we handle the issue gracefully.
+	if (a)
+		push(a->_room);
+	else
+		push(0);
 }
 
 void ScummEngine_v6::o6_getActorWalkBox() {




More information about the Scummvm-git-logs mailing list