From 1dab4170a95c0cdf072ff682366a57c61ec4941e Mon Sep 17 00:00:00 2001 From: James Brown Date: Fri, 27 Dec 2002 00:23:45 +0000 Subject: Patch 650135 (method 3): FOA parrot hang svn-id: r6185 --- scumm/script_v5.cpp | 10 ++++++---- scumm/script_v6.cpp | 13 +++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 1f2afdd98f..f624eec045 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -2348,10 +2348,12 @@ void Scumm_v5::o5_wait() _opcode = fetchScriptByte(); switch (_opcode & 0x1F) { - case 1: /* wait for actor */ - if (derefActorSafe(getVarOrDirectByte(0x80), "o5_wait")->moving) - break; - return; + case 1: { /* wait for actor */ + Actor *a = derefActorSafe(getVarOrDirectByte(0x80), "o5_wait"); + if (a && a->isInCurrentRoom() && a->moving) + break; + return; + } case 2: /* wait for message */ if (_vars[VAR_HAVE_MSG]) break; diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 800405e540..2acdb068aa 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2072,13 +2072,14 @@ void Scumm_v6::o6_wait() { switch (fetchScriptByte()) { case 168:{ - int offs = fetchScriptWordSigned(); - if (derefActorSafe(pop(), "o6_wait")->moving) { - _scriptPointer += offs; - o6_breakHere(); - } - return; + Actor *a = derefActorSafe(pop(), "o6_wait"); + int offs = (int16)fetchScriptWord(); + if (a && a->isInCurrentRoom() && a->moving) { + _scriptPointer += offs; + o6_breakHere(); } + return; + } case 169: // HACK: For Conroy Bumpus' song in Sam & Max. // During the song three calls to o6_wait() appear, -- cgit v1.2.3