From 41df21ed6b898286759510c9b5239213b48abf41 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 24 May 2003 16:09:29 +0000 Subject: temporary work around for bug #742676 (game won't exit anymore, but behaviour is incorrect) svn-id: r7889 --- scumm/script_v6.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'scumm/script_v6.cpp') diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 861c014f60..50cf973a5a 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -1003,7 +1003,16 @@ void Scumm_v6::o6_walkActorToObj() { getObjectXYPos(obj, x, y, dir); a->startWalkActor(x, y, dir); } else { - a2 = derefActor(obj, "o6_walkActorToObj(2)"); + a2 = derefActorSafe(obj, "o6_walkActorToObj(2)"); + if (a2 == 0) { + // FIXME: This is a hack to work around bug #742676 SAM: Fish Farm. + // However, that this ever happens seems to be due to a bug in + // ScummVM, esp. since even with this hack the behaviour of Sam + // is not correct (when using the fish he says "This is a completely + // unusable thingamabob", but should say "Wow, he's blowing bubbles". + warning("o6_walkActorToObj: invalid actor %d\n", obj); + return; + } if (!a->isInCurrentRoom() || !a2->isInCurrentRoom()) return; if (dist == 0) { @@ -1081,15 +1090,15 @@ void Scumm_v6::o6_animateActor() { } void Scumm_v6::o6_doSentence() { - int a, b, c; + int verb, objectA, objectB, dummy = 0; - a = pop(); + objectB = pop(); if (!(_features & GF_AFTER_V8)) - pop(); // dummy pop - b = pop(); - c = pop(); + dummy = pop(); // dummy pop + objectA = pop(); + verb = pop(); - doSentence(c, b, a); + doSentence(verb, objectA, objectB); } void Scumm_v6::o6_pickupObject() { -- cgit v1.2.3