[Scummvm-cvs-logs] scummvm master -> 6eb3dc071950690270332ecfa873818a329f4ff6
Strangerke
Strangerke at scummvm.org
Mon Sep 29 23:56:33 CEST 2014
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:
6eb3dc0719 TSAGE: R2R - fix a crash in scene 1337. Remove useless checks
Commit: 6eb3dc071950690270332ecfa873818a329f4ff6
https://github.com/scummvm/scummvm/commit/6eb3dc071950690270332ecfa873818a329f4ff6
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-09-29T23:54:09+02:00
Commit Message:
TSAGE: R2R - fix a crash in scene 1337. Remove useless checks
Changed paths:
engines/tsage/ringworld2/ringworld2_scenes1.cpp
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index e2c22bd..bd5cddf 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;
More information about the Scummvm-git-logs
mailing list