From 2bb81e2d207201265273e36bff8fadaeba6444a1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 3 Jan 2008 10:42:18 +0000 Subject: Properly fixed bug #1861863 - "ITE: Crash when using Eeah with Eeah" svn-id: r30195 --- engines/saga/sfuncs.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'engines/saga') diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index b4bc551316..9a8c865612 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -396,6 +396,13 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { const HitZone *hitZone; Event event; + // If the player uses an object and then immediately reuses that object + // (without it being shown in the verb area), the object returned is wrong (0), + // so we make it equal to the second object here. + // Fixes bug #1861863 - "ITE: Crash when using Eeah with Eeah" + if (theObject == 0 && objectId == 0 && withObject > 0) + theObject = objectId = withObject; + switch (objectTypeId(objectId)) { case kGameObjectObject: obj = _vm->_actor->getObj(objectId); @@ -436,8 +443,6 @@ void Script::sfScriptDoAction(SCRIPTFUNC_PARAMS) { break; default: // Unknown case, do nothing - // Changing this from an error to a warning should fix bug - // #1861863 - "ITE: Crash when using Eeah with Eeah" warning("Script::sfScriptDoAction wrong object type 0x%X", objectId); return; } -- cgit v1.2.3