From 14f12c3d6c9bebe997f9e04465a751d71f00c632 Mon Sep 17 00:00:00 2001 From: Donovan Watteau Date: Mon, 26 Sep 2022 15:30:32 +0200 Subject: [PATCH] SCUMM: Fix the storekeeper closing the door in MI1CD (WORKAROUND) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the v5 releases of Monkey Island 1, the storekeeper on Mêlée Island closes the door *after* going to the counter, which looks very strange since he's far away from it, at this point. In the v4 releases, he just closes it *before* walking away from it, which is much more natural. AFAIK the storekeeper isn't meant to have the same Jedi powers as the troll on the bridge, so that's probably yet another scripting oversight from the SCUMM v4 to v5 update. Fix this by calling the related script a bit earlier. This was already fixed in the SegaCD release and in the Ultimate Talkie edition. --- engines/scumm/script_v5.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp index f7b10714c5c..faaf24177d3 100644 --- a/engines/scumm/script_v5.cpp +++ b/engines/scumm/script_v5.cpp @@ -3130,6 +3130,24 @@ void ScummEngine_v5::o5_walkActorTo() { a = derefActor(getVarOrDirectByte(PARAM_1), "o5_walkActorTo"); x = getVarOrDirectWord(PARAM_2); y = getVarOrDirectWord(PARAM_3); + + // WORKAROUND: In MI1 CD, when the storekeeper comes back from outside, + // he will close the door *after* going to his counter, which looks very + // strange, since he's then quite far away from the door. Force calling + // the script which closes the door *before* he starts walking away from + // it, as in the other releases. Another v5 bug fixed on SegaCD, though! + if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformSegaCD && _currentRoom == 30 && + vm.slot[_currentScript].number == 207 && a->_number == 11 && x == 232 && y == 141 && + _enableEnhancements && strcmp(_game.variant, "SE Talkie") != 0) { + if (whereIsObject(387) == WIO_ROOM && getState(387) == 1 && getState(437) == 1) { + int args[NUM_SCRIPT_LOCAL]; + memset(args, 0, sizeof(args)); + args[0] = 387; + args[1] = 437; + runScript(26, 0, 0, args); + } + } + a->startWalkActor(x, y, -1); }