diff options
author | Eugene Sandulenko | 2016-09-02 23:38:39 +0200 |
---|---|---|
committer | GitHub | 2016-09-02 23:38:39 +0200 |
commit | d4f9c0e361cb85d9674e44c6762722ac84be0d2d (patch) | |
tree | f16198b1c64d042dadf07de1c06ade0248b4ccfd | |
parent | 3c619d85890f540e4bbb8da24779987bee315dfd (diff) | |
parent | 940bb41526da8e16889effc803f029128043b5d8 (diff) | |
download | scummvm-rg350-d4f9c0e361cb85d9674e44c6762722ac84be0d2d.tar.gz scummvm-rg350-d4f9c0e361cb85d9674e44c6762722ac84be0d2d.tar.bz2 scummvm-rg350-d4f9c0e361cb85d9674e44c6762722ac84be0d2d.zip |
Merge pull request #821 from BenCastricum/bugfixes
SCUMM: Bugfixes
-rw-r--r-- | engines/scumm/he/intern_he.h | 3 | ||||
-rw-r--r-- | engines/scumm/object.cpp | 10 | ||||
-rw-r--r-- | engines/scumm/script_v6.cpp | 11 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 24 |
4 files changed, 48 insertions, 0 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 8d7ed81dd8..8a562ea7b5 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -56,9 +56,11 @@ public: Common::Rect _actorClipOverride; // HE specific int _heTimers[16]; + uint32 _pauseStartTime; int getHETimer(int timer); void setHETimer(int timer); + void pauseHETimers(bool pause); public: ScummEngine_v60he(OSystem *syst, const DetectorResult &dr); @@ -94,6 +96,7 @@ protected: Common::WriteStream *openSaveFileForAppending(const byte *fileName); void deleteSaveFile(const byte *fileName); void renameSaveFile(const byte *from, const byte *to); + void pauseEngineIntern(bool pause); Common::SeekableReadStream *openSaveFileForReading(int slot, bool compat, Common::String &fileName); Common::WriteStream *openSaveFileForWriting(int slot, bool compat, Common::String &fileName); diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp index da94a34baf..cbc24a8b7e 100644 --- a/engines/scumm/object.cpp +++ b/engines/scumm/object.cpp @@ -110,6 +110,16 @@ void ScummEngine::setOwnerOf(int obj, int owner) { // This causes it to try to remove object 0 from the inventory. if (_game.id == GID_PASS && obj == 0 && vm.slot[_currentScript].number == 94) return; + + // WORKAROUND for bug #6802: assert() was triggered in freddi2. + // Bug is in room 39. Problem is script 10, in the localvar2==78 case; + // this only sets the obj id if var198 is non-zero, but in the asserting + // case, it is obj 0. That means two setOwnerOf calls are made with obj 0. + // The correct setOwnerOf calls are made afterwards, so just ignoring this + // seems to work just fine. + if (_game.id == GID_HEGAME && obj == 0 && _currentRoom == 39 && vm.slot[_currentScript].number == 10) + return; + assert(obj > 0); if (owner == 0) { diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 6c81f17f2f..62c62c0b4a 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -707,6 +707,17 @@ void ScummEngine_v6::o6_ifNot() { void ScummEngine_v6::o6_jump() { int offset = fetchScriptWordSigned(); + // WORKAROUND bug #6097: Pressing escape at the lake side entrance of + // the cave while Putt Putt is not on solid ground and still talking + // will cause the raft to disappear. This is a script bug in the + // original game and affects several versions. + if (_game.id == GID_PUTTZOO) { + if (_game.heversion == 73 && vm.slot[_currentScript].number == 206 && offset == 176 && !isScriptRunning(202)) + _scummVars[244] = 35; + if (_game.features & GF_HE_985 && vm.slot[_currentScript].number == 2054 && offset == 178 && !isScriptRunning(2050)) + _scummVars[202] = 35; + } + // WORKAROUND bug #2826144: Talking to the guard at the bigfoot party, after // he's let you inside, will cause the game to hang, if you end the conversation. // This is a script bug, due to a missing jump in one segment of the script. diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 72c6909f8c..107228453e 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -2589,6 +2589,30 @@ void ScummEngine_v60he::setHETimer(int timer) { _heTimers[timer] = _system->getMillis(); } +void ScummEngine_v60he::pauseHETimers(bool pause) { + // The HE timers rely on system time which of course doesn't pause when + // the engine does. By adding the elapsed time we compensate for this. + // Fixes bug #6352 + if (pause) { + // Pauses can be layered, we only need the start of the first + if (!_pauseStartTime) + _pauseStartTime = _system->getMillis(); + } else { + int elapsedTime = _system->getMillis() - _pauseStartTime; + for (int i = 0; i < ARRAYSIZE(_heTimers); i++) { + if (_heTimers[i] != 0) + _heTimers[i] += elapsedTime; + } + _pauseStartTime = 0; + } +} + +void ScummEngine_v60he::pauseEngineIntern(bool pause) { + pauseHETimers(pause); + + ScummEngine::pauseEngineIntern(pause); +} + void ScummEngine::pauseGame() { pauseDialog(); } |