Skip to content

Commit

Permalink
SCUMM: 2nd try to fix dungeon door timing
Browse files Browse the repository at this point in the history
Shorten the timer delay does not work as escaping with a second kid is not possible too. Instead decrease engine speed during script execution.
  • Loading branch information
tobigun committed Feb 11, 2012
1 parent 4519e56 commit 0bae642
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 0 additions & 11 deletions engines/scumm/script_v2.cpp
Expand Up @@ -1433,17 +1433,6 @@ void ScummEngine_v2::o2_delay() {
delay |= fetchScriptByte() << 16;
delay = 0xFFFFFF - delay;

// WORKAROUND: walking speed in the original v0/v1 interpreter
// is sometimes slower (e.g. during scrolling) than in ScummVM.
// Hence, the delay for the door-closing action in the dungeon
// is to long, so a single kid is able to escape -> shorten delay.
int script = vm.slot[_currentScript].number;
if ((_game.version == 0 && script == 132) ||
(_game.version == 1 && script == 137)) {
if (delay == 180)
delay = 120;
}

vm.slot[_currentScript].delay = delay;
vm.slot[_currentScript].status = ssPaused;
o5_breakHere();
Expand Down
8 changes: 8 additions & 0 deletions engines/scumm/scumm.cpp
Expand Up @@ -1964,6 +1964,14 @@ Common::Error ScummEngine::go() {
if (delta < 1) // Ensure we don't get into an endless loop
delta = 1; // by not decreasing sleepers.

// WORKAROUND: walking speed in the original v0/v1 interpreter
// is sometimes slower (e.g. during scrolling) than in ScummVM.
// This is important for the door-closing action in the dungeon,
// otherwise (delta < 6) a single kid is able to escape.
if ((_game.version == 0 && isScriptRunning(132)) ||
(_game.version == 1 && isScriptRunning(137)))
delta = 6;

// Wait...
waitForTimer(delta * 1000 / 60 - diff);

Expand Down

0 comments on commit 0bae642

Please sign in to comment.