diff options
author | Eugene Sandulenko | 2005-05-16 19:52:46 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-05-16 19:52:46 +0000 |
commit | e4ac8cb870ead3902bfaf652d8656aa88e45e9a2 (patch) | |
tree | 21fb80e40ea6068f73daafb0868ab3a5eefe35a3 /scumm/boxes.cpp | |
parent | 7fa84d94ad2c723dcce7a5f3baea5a6e2e070578 (diff) | |
download | scummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.tar.gz scummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.tar.bz2 scummvm-rg350-e4ac8cb870ead3902bfaf652d8656aa88e45e9a2.zip |
Fix from Quiteust for boxes in MM NES.
svn-id: r18132
Diffstat (limited to 'scumm/boxes.cpp')
-rw-r--r-- | scumm/boxes.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index 7a9643204a..88709b0679 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -117,6 +117,8 @@ void ScummEngine::setBoxFlags(int box, int val) { } else { Box *ptr = getBoxBaseAddr(box); assert(ptr); + if (!ptr) + return; if (_version == 8) ptr->v8.flags = TO_LE_32(val); else if (_version <= 2) @@ -368,6 +370,11 @@ Box *ScummEngine::getBoxBaseAddr(int box) { if (!ptr || box == 255) return NULL; + // The NES version of Maniac Mansion attempts to set flags for boxes 2-4 + // when there are only three boxes (0-2) when walking out to the garage. + if ((_gameId == GID_MANIAC) && (_platform == Common::kPlatformNES) && (box >= ptr[0])) + return NULL; + // FIXME: In "pass to adventure", the loom demo, when bobbin enters // the tent to the elders, box = 2, but ptr[0] = 2 -> errors out. // Hence we disable the check for now. Maybe in PASS (and other old games) |