diff options
author | Sven Hesse | 2007-02-06 19:16:41 +0000 |
---|---|---|
committer | Sven Hesse | 2007-02-06 19:16:41 +0000 |
commit | 1c9c972d055966988c0f4e130eb8f7b380bc365e (patch) | |
tree | 91951b9b2bcc354c14719c5a13870f7929cc7b40 | |
parent | d706d8e4c0fdcda0c3644fe8e8d266031b22c67a (diff) | |
download | scummvm-rg350-1c9c972d055966988c0f4e130eb8f7b380bc365e.tar.gz scummvm-rg350-1c9c972d055966988c0f4e130eb8f7b380bc365e.tar.bz2 scummvm-rg350-1c9c972d055966988c0f4e130eb8f7b380bc365e.zip |
- Fixed Ween's inventory in the volcano (#1630113)
- Added a range check to avoid invalid reads into _wayPoints in Map::checkDirectPath()
svn-id: r25402
-rw-r--r-- | engines/gob/game_v2.cpp | 2 | ||||
-rw-r--r-- | engines/gob/map.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index c85482fb6c..9dff07a6dd 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -282,7 +282,7 @@ void Game_v2::playTot(int16 skipPlay) { _vm->_inter->initControlVars(0); _vm->_scenery->_pCaptureCounter = oldCaptureCounter; _vm->_global->_inter_execPtr = (char *)_totFileData; - _vm->_global->_inter_execPtr += (int16) READ_LE_UINT16(_totFileData + (skipPlay << 1) + 0x66); + _vm->_global->_inter_execPtr += READ_LE_UINT16(_totFileData + (skipPlay << 1) + 0x66); _vm->_inter->callSub(2); if (_vm->_inter->_terminate != 0) _vm->_inter->_terminate = 2; diff --git a/engines/gob/map.cpp b/engines/gob/map.cpp index 4068850be1..b58ff5ec6a 100644 --- a/engines/gob/map.cpp +++ b/engines/gob/map.cpp @@ -258,7 +258,7 @@ int16 Map::checkDirectPath(Mult::Mult_Object *obj, int16 x0, int16 y0, int16 x1, if (obj->nearestWayPoint < obj->nearestDest) if (_wayPoints[obj->nearestWayPoint + 1].field_2 == 1) return 3; - if (_wayPoints[obj->nearestDest - 1].field_2 == 1) + if ((obj->nearestDest > 0) && (_wayPoints[obj->nearestDest - 1].field_2 == 1)) return 3; } |