From 2f753222fed65a1e4de04fca65da97fb591e5343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Andersson?= Date: Fri, 25 Feb 2022 09:00:26 +0100 Subject: [PATCH] SCUMM: Work around timing bug when Mandible uses distaff in VGA Loom The first and second animation when Mandible uses the distaff were so close that they looked like one, and it looked like the second one was missing. This patch adjusts the timing of the second one. --- engines/scumm/script_v5.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index bbba93adbc2..9a6bf8ce794 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -1338,7 +1338,8 @@ void ScummEngine_v5::o5_isLess() { } void ScummEngine_v5::o5_isLessEqual() { - int16 a = getVar(); + int var = fetchScriptWord(); + int16 a = readVar(var); int16 b = getVarOrDirectWord(PARAM_1); // WORKAROUND bug #1266 : Work around a bug in Indy3Town. @@ -1349,6 +1350,16 @@ void ScummEngine_v5::o5_isLessEqual() { return; } + // WORKAROUND: When Mandible uses the distaff, it seems to light up + // only three times with no animation for the second note. Actually, + // the animations for the first and second notes are played so closely + // together that they look like one. This adjusts the timing of the + // second one. + + if (_game.id == GID_LOOM && _game.version >= 4 && _language == Common::EN_ANY && vm.slot[_currentScript].number == 95 && var == VAR_MUSIC_TIMER && b == 1708) { + b = 1815; + } + jumpRelative(b <= a); }