[Scummvm-git-logs] scummvm master -> 9f44c5522aa6a935c030a7c475f1a5b18ecb2481
bluegr
bluegr at gmail.com
Sun Aug 22 21:08:12 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ccc7412c57 SCUMM: MONKEY-VGA fix bug #346, Object stopped with active cutscene
9f44c5522a SCUMM: MONKEY-VGA fix bug #10571, Object stopped with active cutscene
Commit: ccc7412c57e3d88476a3ba9682c2d97b66f5c690
https://github.com/scummvm/scummvm/commit/ccc7412c57e3d88476a3ba9682c2d97b66f5c690
Author: Ben Castricum (github at bencastricum.nl)
Date: 2021-08-23T00:08:08+03:00
Commit Message:
SCUMM: MONKEY-VGA fix bug #346, Object stopped with active cutscene
Also occurs in original.
In script 204 room 25 (Cannibal Village) a crash can occur when you are
expected to give something to the cannibals, but instead look at certain
items like the compass or kidnap note. Those inventory items contain little
cutscenes and are abrubtly stopped by the cutscene in script 204 at 0x0060.
This workaround changes the result of isScriptRunning(164) to also wait for
any inventory scripts that are in a cutscene state, preventing the crash.
Script #204
[0000] (1A) Bit[354] = 1;
[0005] (1A) Var[249] = 0;
[000A] (5D) setClass(303,[32]);
[0011] (DD) setClass(VAR_EGO,[5]);
[0018] (2E) delay(1200);
[001C] (80) breakHere();
[001D] (68) VAR_RESULT = isScriptRunning(164);
[0021] (A8) if (VAR_RESULT) {
[0026] (18) goto 001C;
[0029] (**) }
[0029] (58) endOverride();
[002B] (91) animateCostume(VAR_EGO,3);
[002F] (5D) setClass(303,[160]);
[0036] (40) cutscene([]);
[0038] (AE) WaitForMessage();
[003A] (14) print(5,[Text("Obviously you have nothing for us.")]);
[0060] (C0) endCutscene();
[0061] (2A) startScript(105,[],F);
[0064] (A0) stopObjectCode();
END
Changed paths:
engines/scumm/script_v5.cpp
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index cb5d3ddbd7..bfc8e7b3da 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -1215,6 +1215,23 @@ void ScummEngine_v5::o5_getRandomNr() {
void ScummEngine_v5::o5_isScriptRunning() {
getResultPos();
setResult(isScriptRunning(getVarOrDirectByte(PARAM_1)));
+
+ // WORKAROUND bug #346 (also occurs in original): Object stopped with active cutscene
+ // In script 204 room 25 (Cannibal Village) a crash can occur when you are
+ // expected to give something to the cannibals, but instead look at certain
+ // items like the compass or kidnap note. Those inventory items contain little
+ // cutscenes and are abrubtly stopped by the endcutscene in script 204 at 0x0060.
+ // This patch changes the the result of isScriptRunning(164) to also wait for
+ // any inventory scripts that are in a cutscene state, preventing the crash.
+ if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 204 && _currentRoom == 25) {
+ ScriptSlot *ss = vm.slot;
+ for (int i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) {
+ if (ss->status != ssDead && ss->where == WIO_INVENTORY && ss->cutsceneOverride) {
+ setResult(1);
+ return;
+ }
+ }
+ }
}
void ScummEngine_v5::o5_getVerbEntrypoint() {
Commit: 9f44c5522aa6a935c030a7c475f1a5b18ecb2481
https://github.com/scummvm/scummvm/commit/9f44c5522aa6a935c030a7c475f1a5b18ecb2481
Author: Ben Castricum (github at bencastricum.nl)
Date: 2021-08-23T00:08:08+03:00
Commit Message:
SCUMM: MONKEY-VGA fix bug #10571, Object stopped with active cutscene
Also occurs in original
Script 68 contains the code for handling the mugs. The issue occurs when a mug
changes state. It will call setObjectName for the new state which in its turn
restarts objects in inventory. Some objects (kidnap note) can be in a cutscene state
what causes a crash if the object gets restarted. This workaroud waits for cutscenes
to end, preventing the crash.
Script #68
[0000] (DD) setClass(Local[0],[146]);
[0007] (28) if (!Bit[421]) {
[000C] (1A) Bit[421] = 1;
[0011] (62) stopScript(201);
[0013] (62) stopScript(188);
[0015] (80) breakHere();
[0016] (D8) printEgo([Text(sound(0x612F889, 0xA) + "This stuff is eating right through the mug!")]);
[0054] (80) breakHere();
[0055] (0A) startScript(201,[]);
[0058] (**) }
[0058] (2E) delay(300);
[005C] (DD) setClass(Local[0],[147]);
[0063] (D4) setObjectName(Local[0],"melting mug");
[0072] (1A) Var[233] = 500;
[0077] (48) if (VAR_ROOM == 33) {
[007E] (3A) Var[233] -= 2;
[0083] (48) } else if (VAR_ROOM == 35) {
[008D] (3A) Var[233] -= 3;
[0092] (48) } else if (VAR_ROOM == 34) {
[009C] (3A) Var[233] -= 5;
[00A1] (18) } else {
[00A4] (3A) Var[233] -= 1;
[00A9] (**) }
[00A9] (80) breakHere();
[00AA] (78) unless (Var[233] < 1) goto 0077;
[00B1] (DD) setClass(Local[0],[134]);
[00B8] (D4) setObjectName(Local[0],"mug near death");
[00CA] (2E) delay(300);
[00CE] (DD) setClass(Local[0],[12]);
[00D5] (D4) setObjectName(Local[0],"pewter wad");
[00E3] (9A) Local[1] = VAR_ROOM;
[00E8] (80) breakHere();
[00E9] (C8) if (Local[1] == VAR_ROOM) {
[00F0] (18) goto 00E8;
[00F3] (**) }
[00F3] (A9) setOwnerOf(Local[0],0);
[00F7] (A9) setOwnerOf(Local[0],15);
[00FB] (0A) startScript(11,[]);
[00FE] (0A) startScript(12,[]);
[0101] (DD) setClass(Local[0],[19,6,140]);
[010E] (0C) Resource.unlockScript(69);
[0111] (A0) stopObjectCode();
END
Changed paths:
engines/scumm/script_v5.cpp
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index bfc8e7b3da..0f95070027 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -2088,6 +2088,21 @@ void ScummEngine_v5::o5_setCameraAt() {
}
void ScummEngine_v5::o5_setObjectName() {
+ // WORKAROUND bug #10571 (also occurs in original) Object stopped with active cutscene
+ // Script 68 contains the code for handling the mugs. The issue occurs when a mug
+ // changes state. It will call setObjectName for the new state which in its turn
+ // restarts objects in inventory. Some objects (kidnap note) can be in a cutscene state
+ // what causes a crash if the object gets restarted. This workaroud waits for cutscenes
+ // to end, preventing the crash.
+ if (_game.id == GID_MONKEY && vm.slot[_currentScript].number == 68) {
+ ScriptSlot *ss = vm.slot;
+ for (int i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) {
+ if (ss->status != ssDead && ss->where == WIO_INVENTORY && ss->cutsceneOverride) {
+ _scriptPointer--;
+ return o5_breakHere();
+ }
+ }
+ }
int obj = getVarOrDirectWord(PARAM_1);
setObjectName(obj);
}
More information about the Scummvm-git-logs
mailing list