[Scummvm-cvs-logs] scummvm master -> 351ce463ca1de2d4241162d88653022d65fd004d

Strangerke Strangerke at scummvm.org
Tue Nov 24 17:50:10 CET 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
351ce463ca MADS: Phantom: Add more checks in exitCatacombs


Commit: 351ce463ca1de2d4241162d88653022d65fd004d
    https://github.com/scummvm/scummvm/commit/351ce463ca1de2d4241162d88653022d65fd004d
Author: Strangerke (strangerke at scummvm.org)
Date: 2015-11-24T17:44:21+01:00

Commit Message:
MADS: Phantom: Add more checks in exitCatacombs

Fix an assert in moveCatacombs

Changed paths:
    engines/mads/phantom/game_phantom.cpp



diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp
index b806c1e..dd649d1 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]);






More information about the Scummvm-git-logs mailing list