diff options
author | Gregory Montoir | 2006-02-27 22:15:21 +0000 |
---|---|---|
committer | Gregory Montoir | 2006-02-27 22:15:21 +0000 |
commit | 1b1bc9cde4071ceda6531f0d12c7cbf9be77b582 (patch) | |
tree | d4738c2fe87d8a798ceffed2355a8a4d1a8b45ae | |
parent | 0f5ef6f5b1a87003c819f480933d07a15e38d79b (diff) | |
download | scummvm-rg350-1b1bc9cde4071ceda6531f0d12c7cbf9be77b582.tar.gz scummvm-rg350-1b1bc9cde4071ceda6531f0d12c7cbf9be77b582.tar.bz2 scummvm-rg350-1b1bc9cde4071ceda6531f0d12c7cbf9be77b582.zip |
Revert the 'get rid of SO_WAIT_FOR_TURN workaround' commit but keep it specific to TheDig
svn-id: r20959
-rw-r--r-- | engines/scumm/script_v6.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index e1f39635f0..9aa73d3f01 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -2231,8 +2231,21 @@ void ScummEngine_v6::o6_wait() { break; return; case 232: // SO_WAIT_FOR_TURN + // FIXME: This opcode is really odd. It's used a lot in The Dig. + // But sometimes it receives the actor ID as params, and sometimes an + // angle. However in (almost?) all cases, just before calling it, _curActor + // is set, so we can use it. I tried to add code that detects if an angle + // is passed, and if so, wait till that angle is reached, but that leads to hangs. + // Disassembly doesn't show anything special for that opcode, though. + // + // For now, if the value passed in is divisible by 45, assume it is an + // angle, and use _curActor as the actor to wait for. See bug report #744441 offs = fetchScriptWordSigned(); - actnum = pop(); + actnum = pop(); + if (_game.id == GID_DIG && actnum % 45 == 0) { + warning("Working around invalid actor num %d", actnum); + actnum = _curActor; + } a = derefActor(actnum, "o6_wait:232b"); if (a->isInCurrentRoom() && a->_moving & MF_TURN) break; |