diff options
author | Gregory Montoir | 2004-01-16 15:51:23 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-16 15:51:23 +0000 |
commit | 770d94b6071d5cd4ba0f4db7127b032c72c02a47 (patch) | |
tree | 0a789ccecd05002b896348e7f0c4074da479a5fd /queen | |
parent | 3c521dc28858ef845ae0f0deae8f708fd1320421 (diff) | |
download | scummvm-rg350-770d94b6071d5cd4ba0f4db7127b032c72c02a47.tar.gz scummvm-rg350-770d94b6071d5cd4ba0f4db7127b032c72c02a47.tar.bz2 scummvm-rg350-770d94b6071d5cd4ba0f4db7127b032c72c02a47.zip |
some assert() calls
svn-id: r12435
Diffstat (limited to 'queen')
-rw-r--r-- | queen/command.cpp | 1 | ||||
-rw-r--r-- | queen/logic.cpp | 3 | ||||
-rw-r--r-- | queen/talk.cpp | 2 | ||||
-rw-r--r-- | queen/walk.cpp | 3 |
4 files changed, 6 insertions, 3 deletions
diff --git a/queen/command.cpp b/queen/command.cpp index 8b0636c82c..b2811d7161 100644 --- a/queen/command.cpp +++ b/queen/command.cpp @@ -143,6 +143,7 @@ void Command::executeCurrentAction() { uint16 i; for (i = 1; i <= _numCmdList; ++i, ++cmdList) { if (cmdList->match(_state.selAction, _state.subject[0], _state.subject[1])) { + assert(comMax < MAX_MATCHING_CMDS); matchingCmds[comMax] = i; ++comMax; } diff --git a/queen/logic.cpp b/queen/logic.cpp index 56eba6566f..5bd080d763 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -299,8 +299,7 @@ uint16 Logic::findBob(uint16 obj) { img -= 5000; } - if (img > _numGraphics) - warning("img (%i) > _numGraphics (%i)", img, _numGraphics); + assert (img <= _numGraphics); if(_graphicData[img].lastFrame != 0) { ++idxAnimated; diff --git a/queen/talk.cpp b/queen/talk.cpp index d51dafe1db..a66b6d707f 100644 --- a/queen/talk.cpp +++ b/queen/talk.cpp @@ -1289,7 +1289,7 @@ int16 Talk::selectSentence() { // Function TALK_BOB (lines 577-739) in talk.c int selectedSentence = 0; - int scrollX = 0; // XXX: global variable + int scrollX = _vm->display()->horizontalScroll(); int startOption = 1; int optionLines = 0; char optionText[5][MAX_STRING_SIZE]; diff --git a/queen/walk.cpp b/queen/walk.cpp index 1df150ac17..445827052d 100644 --- a/queen/walk.cpp +++ b/queen/walk.cpp @@ -540,9 +540,11 @@ bool Walk::calcPath(uint16 oldArea, uint16 newArea) { area = _areaList[_areaListCount]; } else { ++_areaListCount; + assert(_areaListCount < MAX_WALK_DATA); _areaList[_areaListCount] = area; if(!isAreaStruck(area)) { ++_areaStrikeCount; + assert(_areaStrikeCount < MAX_WALK_DATA); _areaStrike[_areaStrikeCount] = area; } } @@ -567,6 +569,7 @@ void Walk::incWalkData(int16 px, int16 py, int16 x, int16 y, uint16 areaNum) { debug(9, "Walk::incWalkData(%d, %d, %d)", (x - px), (y - py), areaNum); if (px != x || py != y) { ++_walkDataCount; + assert(_walkDataCount < MAX_WALK_DATA); WalkData *pwd = &_walkData[_walkDataCount]; pwd->dx = x - px; pwd->dy = y - py; |