Opened 8 weeks ago

Closed 6 weeks ago

#15018 closed defect (fixed)

MONKEY1 (Demo): Can't give breath mint to Otis in standalone demo

Reported by: SomeRandomHEFan Owned by: AndywinXp
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: SomeRandomHEFan Game: Monkey Island 1

Description

Attempting to give Otis a breath mint does nothing at all. This makes the demo impossible to complete. It works just fine in the Passport to Adventure demo.

Change History (5)

comment:1 by AndywinXp, 8 weeks ago

Summary: Can't give breath mint to Otis in standalone demoMONKEY1 (Demo): Can't give breath mint to Otis in standalone demo

Thanks, I'll take a look...

comment:2 by eriktorbjorn, 7 weeks ago

Just a quick note that it works in DOSBox, so it certainly does seem like a ScummVM bug.

comment:3 by eriktorbjorn, 7 weeks ago

This appears to be a regression caused by this commit:

34bc417d12a27dab03d72c158e97af789439001d is the first bad commit
commit 34bc417d12a27dab03d72c158e97af789439001d
Author: Pragyansh Chaturvedi <76248539+r41k0u@users.noreply.github.com>
Date:   Mon Mar 7 15:58:09 2022 +0530

    SCUMM: Fix bug #13196 - Invalid phrase with GIVE crashes Monkey EGA Demo
    
    * SCUMM: Fix Invalid phrase with GIVE crashes Monkey Island EGA Demo
    * SCUMM: Suggested changes on Pull #3731
    * SCUMM: specify game id in Pull #3731
    * SCUMM: seperated AMIGA monkey VGA and VGA Demo variants. Assigned GF_DEMO flags

 devtools/scumm-md5.txt           |  2 +-
 engines/scumm/detection_tables.h |  3 ++-
 engines/scumm/script_v5.cpp      | 17 +++++++++++++++++
 engines/scumm/scumm-md5.h        |  4 ++--
 4 files changed, 22 insertions(+), 4 deletions(-)

A hack was introduced to ensure that the breath mint can only be given to "valid actors". Apparently, in the demo Otis isn't an actor?

comment:4 by eriktorbjorn, 7 weeks ago

Removing the hack and adding this one instead seems like the obvious solution to me:

diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index a2adf87dfac..64737deee36 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1206,8 +1206,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);
 }

But that's just a guess.

comment:5 by AndywinXp, 6 weeks ago

Owner: set to AndywinXp
Resolution: fixed
Status: newclosed

Aaand the guess is correct! Thanks! Closing...

Note: See TracTickets for help on using tickets.