SCUMM: Fix the storekeeper closing the door in MI1CD (WORKAROUND)

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.
This commit is contained in:
Donovan Watteau 2022-09-26 15:30:32 +02:00 committed by Filippos Karapetis
parent 23c2941421
commit 14f12c3d6c

View file

@ -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);
}