some assert() calls

svn-id: r12435
This commit is contained in:
Gregory Montoir 2004-01-16 15:51:23 +00:00
parent 3c521dc288
commit 770d94b607
4 changed files with 6 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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];

View File

@ -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;