diff options
author | Strangerke | 2014-09-29 23:54:09 +0200 |
---|---|---|
committer | Strangerke | 2014-09-29 23:54:09 +0200 |
commit | 6eb3dc071950690270332ecfa873818a329f4ff6 (patch) | |
tree | 56bae5e24e330313115102d7476ff5a983dab840 /engines/tsage/ringworld2 | |
parent | 62b98913de165f6fd8663877911fe765fff9a852 (diff) | |
download | scummvm-rg350-6eb3dc071950690270332ecfa873818a329f4ff6.tar.gz scummvm-rg350-6eb3dc071950690270332ecfa873818a329f4ff6.tar.bz2 scummvm-rg350-6eb3dc071950690270332ecfa873818a329f4ff6.zip |
TSAGE: R2R - fix a crash in scene 1337. Remove useless checks
Diffstat (limited to 'engines/tsage/ringworld2')
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes1.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp index e2c22bd0b4..bd5cddfe94 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp @@ -5973,26 +5973,17 @@ void Scene1337::handlePlayer1() { } int count = -1; - int i; - for (i = 0; i <= 3; i++) { + for (int i = 0; i <= 3; i++) { int tmpVal = isDelayCard(_gameBoardSide[1]._handCard[i]._cardId); if (tmpVal != -1) { int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3); for (int j = 0; j <= 3; j++) { - //CHECKME: tmpVal or rndVal? - // FIXME: This is probably meant to be rndVal, but not clear... - if (tmpVal < 0 || tmpVal >= ARRAYSIZE(_gameBoardSide)) - error("Scene1337::handlePlayer1() tmpVal:%d out of range 0 to %d", tmpVal, ARRAYSIZE(_gameBoardSide)-1); - - if (tmpVal != 1) { - if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && isAttackPossible(tmpVal, _gameBoardSide[1]._handCard[i]._cardId)) - count = tmpVal; + if (rndVal != 1) { + if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && isAttackPossible(rndVal, _gameBoardSide[1]._handCard[i]._cardId)) + count = rndVal; } - if (count < 0 || count >= ARRAYSIZE(_gameBoardSide)) - error("Scene1337::handlePlayer1() count:%d out of range 0 to %d", count, ARRAYSIZE(_gameBoardSide)-1); - if (count != -1) { playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard); return; |