SCUMM: Work around a small glitch with Largo's door in Monkey2

If one closes the door just before using the pins with the voodoo doll
in front of Largo, the middle of the door will glitch when Largo opens
it again to escape from his room.

It looks like script 13-200 forgot to clean the part of the door which
deals with the (invisible) laundry claim ticket, in this case. But
script 13-213 triggers the same action without any problem, since this
one properly updates the class and state of this object; so let's just
reuse its `setState(111,2)` and `setClass(111,[160])` calls.
This commit is contained in:
Donovan Watteau 2022-08-15 18:21:11 +02:00 committed by Filippos Karapetis
parent d47127aa90
commit 27f2307b8a

View file

@ -2450,8 +2450,21 @@ void ScummEngine_v5::o5_setOwnerOf() {
void ScummEngine_v5::o5_setState() {
int obj, state;
obj = getVarOrDirectWord(PARAM_1);
state = getVarOrDirectByte(PARAM_2);
// WORKAROUND: The door will glitch if one closes it before using the voodoo
// doll on Largo. Script 13-213 triggers the same action without any glitch,
// though, since it properly resets the state of the (invisible) laundry claim
// ticket part of the door, so we just reuse its setState and setClass calls.
if (_game.id == GID_MONKEY2 && _currentRoom == 13 && vm.slot[_currentScript].number == 200 &&
obj == 108 && state == 1 && getState(100) != 1 && getState(111) != 2 && _enableEnhancements) {
putState(111, 2);
markObjectRectAsDirty(111);
putClass(111, 160, true);
}
putState(obj, state);
markObjectRectAsDirty(obj);
if (_bgNeedsRedraw)