aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-09-29 23:57:51 +0200
committerStrangerke2014-09-29 23:57:51 +0200
commite37a92fc7bbe990f59cb86a61217268bba18a3d4 (patch)
treecf8ea76012f58e1f7da77aa88f95694bee8f0b5e
parent6eb3dc071950690270332ecfa873818a329f4ff6 (diff)
downloadscummvm-rg350-e37a92fc7bbe990f59cb86a61217268bba18a3d4.tar.gz
scummvm-rg350-e37a92fc7bbe990f59cb86a61217268bba18a3d4.tar.bz2
scummvm-rg350-e37a92fc7bbe990f59cb86a61217268bba18a3d4.zip
TSAGE: R2R - Reduce the scope of a variable, some renaming
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index bd5cddfe94..1490bb47c1 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -5972,20 +5972,20 @@ void Scene1337::handlePlayer1() {
}
}
- int count = -1;
for (int i = 0; i <= 3; i++) {
int tmpVal = isDelayCard(_gameBoardSide[1]._handCard[i]._cardId);
if (tmpVal != -1) {
+ int victimId = -1;
int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
for (int j = 0; j <= 3; j++) {
if (rndVal != 1) {
if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && isAttackPossible(rndVal, _gameBoardSide[1]._handCard[i]._cardId))
- count = rndVal;
+ victimId = rndVal;
}
- if (count != -1) {
- playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard);
+ if (victimId != -1) {
+ playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[victimId]._delayCard);
return;
} else {
rndVal--;
@@ -5996,18 +5996,17 @@ void Scene1337::handlePlayer1() {
}
}
- int j;
- for (j = 0; j <= 3; j++) {
+ for (int j = 0; j <= 3; j++) {
if (getStationCardId(_gameBoardSide[1]._handCard[j]._cardId) != -1) {
- count = -1;
+ int victimId = -1;
int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
for (int l = 0; l <= 3; l++) {
if (rndVal != 1) {
if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && (_gameBoardSide[1]._handCard[j]._cardId == 1))
- count = rndVal;
+ victimId = rndVal;
}
- if (count != -1) {
- playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[count]._delayCard);
+ if (victimId != -1) {
+ playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[victimId]._delayCard);
return;
} else {
rndVal--;