[Scummvm-git-logs] scummvm master -> 14d1540e4b9ae59c5498d8056a0d3d9983e2e294

AndywinXp noreply at scummvm.org
Sat Mar 23 09:45:55 UTC 2024


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:
14d1540e4b SCUMM: Fix #15018


Commit: 14d1540e4b9ae59c5498d8056a0d3d9983e2e294
    https://github.com/scummvm/scummvm/commit/14d1540e4b9ae59c5498d8056a0d3d9983e2e294
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-03-23T10:45:38+01:00

Commit Message:
SCUMM: Fix #15018

Thanks eriktorbjorn for the nudge in the right direction ;-)
Confirmed by the disasm.

Changed paths:
    engines/scumm/script_v5.cpp


diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index a2adf87dfac..9e616915681 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -996,22 +996,6 @@ void ScummEngine_v5::o5_doSentence() {
 	int objectA = getVarOrDirectWord(PARAM_2);
 	int objectB = getVarOrDirectWord(PARAM_3);
 
-	//	HACK: breath mint(object 458) should only be given to actors.
-	//	Giving it to non-actor objects crashes the game.
-	//	The sentence doesn't run a script if the recipient is not an actor.
-	//	Trac #13196
-	//	This bug occurred always when breath mint was given to non-actor objects
-	// 	and sometimes when other non actor objects were given to breathe mint
-	//	Giving pot or red herring to breath mint triggered the bug as these two objects' scripts
-	//	reverse the sentence (in case if the user had reversed the items), effectively making the sentence
-	//	such that the breath mint is being given to the pot/red herring.
-	// 	But giving hunk o' meat to breath mint didn't trigger the bug as such reversal is not done
-	//	by hunk o' meat's script.
-	if (((_game.id == GID_MONKEY_VGA && (_game.features & GF_DEMO)) ||
-		 (_game.id == GID_MONKEY_EGA && (_game.features & GF_DEMO)))
-		&& verb == 3 && objectA == 458 && !isValidActor(objectB))
-		return;
-
 	doSentence(verb, objectA, objectB);
 }
 
@@ -1206,8 +1190,9 @@ void ScummEngine_v5::o5_expression() {
 void ScummEngine_v5::o5_faceActor() {
 	int act = getVarOrDirectByte(PARAM_1);
 	int obj = getVarOrDirectWord(PARAM_2);
-	Actor *a = derefActor(act, "o5_faceActor");
-	a->faceToObject(obj);
+	Actor *a = derefActorSafe(act, "o5_faceActor");
+	if (a)
+		a->faceToObject(obj);
 }
 
 void ScummEngine_v5::o5_findInventory() {




More information about the Scummvm-git-logs mailing list