diff options
Diffstat (limited to 'engines/mads/phantom/game_phantom.cpp')
-rw-r--r-- | engines/mads/phantom/game_phantom.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp index b806c1e52a..dd649d1e4a 100644 --- a/engines/mads/phantom/game_phantom.cpp +++ b/engines/mads/phantom/game_phantom.cpp @@ -885,13 +885,14 @@ void GamePhantom::setupCatacombs() { } int GamePhantom::exitCatacombs(int dir) { - int scene = _globals[kCatacombsRoom]; - assert ((scene < _catacombSize) && (dir < 4)); - return (_catacombs[scene]._exit[dir]); + assert(_globals[kCatacombsRoom] == CLIP(_globals[kCatacombsRoom], 0, _catacombSize - 1)); + assert(dir == CLIP(dir, 0, 3)); + + return (_catacombs[_globals[kCatacombsRoom]]._exit[dir]); } void GamePhantom::moveCatacombs(int dir) { - assert(_globals[kCatacombsRoom] == CLIP(_globals[kCatacombsRoom], 0, _catacombSize)); + assert(_globals[kCatacombsRoom] == CLIP(_globals[kCatacombsRoom], 0, _catacombSize - 1)); assert(dir == CLIP(dir, 0, 3)); newCatacombRoom(_catacombs[_globals[kCatacombsRoom]]._fromDirection[dir], _catacombs[_globals[kCatacombsRoom]]._exit[dir]); |