From 5b2ca72a324e2b63cbf7c07880602f19ccacf375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Wed, 23 Jun 2021 19:48:32 +0200 Subject: [PATCH] SCUMM: Fix leftover verbs when giving objects to other characters It looks like the input script - or at least this particular input script - expects to be called twice. Once to clear the verbs and once for the recipient to accept/reject your offer. In the 256-color DOS version, both of these are done during the same call. I don't know if this applies to other input scripts as well, but I'm limiting it to this one for now. --- engines/scumm/script.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index fc0f49723dc..6d13e734902 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -1412,8 +1412,26 @@ void ScummEngine::runInputScript(int clickArea, int val, int mode) { _lastInputScriptTime = time; } - if (verbScript) - runScript(verbScript, 0, 0, args); + if (verbScript) { + // It seems that script 18 expects to be called twice: Once + // with parameter 1 (kVerbClickArea) to clear all the verbs, + // and once with 3 (kInventoryClickArea) to print the "Take + // this " message. + // + // In the 256-color DOS version, this is all done in the same + // call to the script. + // + // Should this workaround apply to other input scripts + // as well? I don't know. + if (_game.id == GID_INDY3 && _game.platform == Common::kPlatformMacintosh && verbScript == 18 && val >= 101 && val <= 106) { + args[0] = kVerbClickArea; + runScript(verbScript, 0, 0, args); + + args[0] = kInventoryClickArea; + runScript(verbScript, 0, 0, args); + } else + runScript(verbScript, 0, 0, args); + } } void ScummEngine::decreaseScriptDelay(int amount) {