[Scummvm-cvs-logs] scummvm master -> e37a92fc7bbe990f59cb86a61217268bba18a3d4

Strangerke Strangerke at scummvm.org
Mon Sep 29 23:59:47 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:
e37a92fc7b TSAGE: R2R - Reduce the scope of a variable, some renaming


Commit: e37a92fc7bbe990f59cb86a61217268bba18a3d4
    https://github.com/scummvm/scummvm/commit/e37a92fc7bbe990f59cb86a61217268bba18a3d4
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-09-29T23:57:51+02:00

Commit Message:
TSAGE: R2R - Reduce the scope of a variable, some renaming

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 bd5cddf..1490bb4 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--;






More information about the Scummvm-git-logs mailing list