[Scummvm-cvs-logs] scummvm master -> 27d1ac113cc194cf16bee7a7e1414961a61f6589

Strangerke Strangerke at scummvm.org
Sun Dec 22 15:14:08 CET 2013


This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
abd0770cdb TSAGE: R2R - Some refactoring in scene 1337
7798c68512 TSAGE: R2R - Scene 1337 - optimize game logic based on board behavior
4ec63a6da1 TSAGE: R2R - Remove dead code in scene 1100 and 1850
8aba76fdad AVALANCHE: Add a default value in Nim::checkInput()
27d1ac113c TSAGE: R2R - Fix a bug after check on _gameBoardSide[0]._delayCard._cardId, some renaming and refactoring


Commit: abd0770cdb84fb536635b32e216e8ea4f746e69c
    https://github.com/scummvm/scummvm/commit/abd0770cdb84fb536635b32e216e8ea4f746e69c
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-22T04:11:11-08:00

Commit Message:
TSAGE: R2R - Some refactoring in scene 1337

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 2d1007d..f471293 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -3158,14 +3158,12 @@ void Scene1337::Action3::signal() {
 		scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332);
 		scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0);
 		scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170);
-		if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) {
-			if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) {
-				scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4);
-				scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25);
-			} else {
-				scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3);
-				scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9);
-			}
+		if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) {
+			scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4);
+			scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25);
+		} else if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) {
+			scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3);
+			scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9);
 		} else {
 			scene->_gameBoardSide[2]._handCard[0]._card.setStrip(2);
 			scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId);
@@ -3237,14 +3235,12 @@ void Scene1337::Action3::signal() {
 		scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0);
 		scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170);
 
-		if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) {
-			if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) {
-				scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4);
-				scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25);
-			} else {
-				scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3);
-				scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9);
-			}
+		if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) {
+			scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4);
+			scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25);
+		} else if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) {
+			scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3);
+			scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9);
 		} else {
 			scene->_gameBoardSide[2]._handCard[1]._card.setStrip(2);
 			scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId);
@@ -3317,14 +3313,12 @@ void Scene1337::Action3::signal() {
 		scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0);
 		scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170);
 
-		if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) {
-			if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) {
-				scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4);
-				scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25);
-			} else {
-				scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3);
-				scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9);
-			}
+		if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) {
+			scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4);
+			scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25);
+		} else if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) {
+			scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3);
+			scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9);
 		} else {
 			scene->_gameBoardSide[2]._handCard[2]._card.setStrip(2);
 			scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId);
@@ -4097,11 +4091,9 @@ void Scene1337::Action11::signal() {
 				} // while
 				scene->_displayHelpFl = true;
 				scene->subC4CEC();
-			} else {
-				if (scene->_actionIdx2 != 2) {
-					int tmpVal = scene->getFreeHandCard(scene->_actionIdx2);
-					scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal];
-				}
+			} else if (scene->_actionIdx2 != 2) {
+				int tmpVal = scene->getFreeHandCard(scene->_actionIdx2);
+				scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal];
 			}
 		}
 
@@ -4264,21 +4256,19 @@ void Scene1337::Action12::signal() {
 					}
 				}
 				scene->subC4CEC();
-			} else {
-				if (scene->_actionIdx1 != 1) {
-					switch (scene->_actionIdx1) {
-					case 0:
-						scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)];
-						break;
-					case 3:
-						scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)];
-						break;
-					default:
-						break;
-					}
-				} else {
-					scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)];
+			} else if (scene->_actionIdx1 != 1) {
+				switch (scene->_actionIdx1) {
+				case 0:
+					scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)];
+					break;
+				case 3:
+					scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)];
+					break;
+				default:
+					break;
 				}
+			} else {
+				scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)];
 			}
 
 			scene->_actionCard1->_card.postInit();
@@ -4553,14 +4543,12 @@ void Scene1337::setAnimationInfo(Card *card) {
 	if (!card)
 		return;
 
-	if (card->_cardId > 9) {
-		if (card->_cardId > 25) {
-			card->_card.setStrip2(4);
-			card->_card.setFrame(card->_cardId - 25);
-		} else {
-			card->_card.setStrip2(3);
-			card->_card.setFrame(card->_cardId - 9);
-		}
+	if (card->_cardId > 25) {
+		card->_card.setStrip2(4);
+		card->_card.setFrame(card->_cardId - 25);
+	} else if (card->_cardId > 9) {
+		card->_card.setStrip2(3);
+		card->_card.setFrame(card->_cardId - 9);
 	} else {
 		card->_card.setStrip2(2);
 		card->_card.setFrame(card->_cardId);
@@ -5514,53 +5502,51 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 						displayDialog(_discardPile._cardId);
 					else
 						actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				} else if (_helpIcon._bounds.contains(pt)) {
+				} else if (_helpIcon._bounds.contains(pt))
 					actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				} else if (_stockCard.isIn(pt)) {
+				else if (_stockCard.isIn(pt))
 					actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				} else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
+				else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
 					     || (_gameBoardSide[3]._emptyStationPos.isIn(pt))
 					     || (_gameBoardSide[0]._emptyStationPos.isIn(pt))
-					     || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) ) {
+					     || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) )
 					actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				} else {
-					if (_gameBoardSide[2]._handCard[0].isIn(pt))
-						displayDialog(_gameBoardSide[2]._handCard[0]._cardId);
-					else if (_gameBoardSide[2]._handCard[1].isIn(pt))
-						displayDialog(_gameBoardSide[2]._handCard[1]._cardId);
-					else if (_gameBoardSide[2]._handCard[2].isIn(pt))
-						displayDialog(_gameBoardSide[2]._handCard[2]._cardId);
-					else if (_gameBoardSide[2]._handCard[3].isIn(pt))
-						displayDialog(_gameBoardSide[2]._handCard[3]._cardId);
-					else if ((curReg >= 6) && (curReg <= 9))
-						actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					else if ((curReg >= 11) && (curReg <= 14))
-						actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					else if ((curReg >= 16) && (curReg <= 19))
-						actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					else {
-						switch (curReg) {
-						case 0:
-							actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
-							break;
-						case 5:
-							actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							break;
-						case 10:
-							actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							break;
-						case 15:
-							actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							break;
-						case 20:
-							actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							break;
-						case 21:
-							actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							break;
-						default:
-							break;
-						}
+				else if (_gameBoardSide[2]._handCard[0].isIn(pt))
+					displayDialog(_gameBoardSide[2]._handCard[0]._cardId);
+				else if (_gameBoardSide[2]._handCard[1].isIn(pt))
+					displayDialog(_gameBoardSide[2]._handCard[1]._cardId);
+				else if (_gameBoardSide[2]._handCard[2].isIn(pt))
+					displayDialog(_gameBoardSide[2]._handCard[2]._cardId);
+				else if (_gameBoardSide[2]._handCard[3].isIn(pt))
+					displayDialog(_gameBoardSide[2]._handCard[3]._cardId);
+				else if ((curReg >= 6) && (curReg <= 9))
+					actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				else if ((curReg >= 11) && (curReg <= 14))
+					actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				else if ((curReg >= 16) && (curReg <= 19))
+					actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				else {
+					switch (curReg) {
+					case 0:
+						actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
+						break;
+					case 5:
+						actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						break;
+					case 10:
+						actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						break;
+					case 15:
+						actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						break;
+					case 20:
+						actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						break;
+					case 21:
+						actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						break;
+					default:
+						break;
 					}
 				}
 			}
@@ -6078,8 +6064,7 @@ void Scene1337::handlePlayer3() {
 			discardCard(&_gameBoardSide[3]._delayCard);
 			return;
 		default:
-			int i;
-			for (i = 0; i <= 3; i++) {
+			for (int i = 0; i <= 3; i++) {
 				if (checkAntiDelayCard(_gameBoardSide[3]._delayCard._cardId, _gameBoardSide[3]._handCard[i]._cardId)) {
 					playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard);
 					return;
@@ -6401,234 +6386,232 @@ void Scene1337::handlePlayer2() {
 						} else {
 							actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 						}
-					} else {
+					} else if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) {
 						// Check anti-delay card
-						if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) {
-							if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-								actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-							} else if (!checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) {
-								if (_gameBoardSide[2]._delayCard._cardId != 0) {
-									switch (_gameBoardSide[2]._delayCard._cardId) {
-									case 11:
-										actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-										break;
-									case 14:
-										actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-										break;
-									case 16:
-										actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-										break;
-									case 24:
-										actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-										break;
-									default:
-										break;
-									}
-								} else {
-									actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+							actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+						} else if (!checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) {
+							if (_gameBoardSide[2]._delayCard._cardId != 0) {
+								switch (_gameBoardSide[2]._delayCard._cardId) {
+								case 11:
+									actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									break;
+								case 14:
+									actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									break;
+								case 16:
+									actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									break;
+								case 24:
+									actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									break;
+								default:
+									break;
 								}
 							} else {
-								playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard);
-								return;
+								actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 							}
 						} else {
-							if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) {
-								if (_selectedCard._cardId == 13) {
-									if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										for (int k = 0; k <= 7; k++) {
-											if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) {
-												playCounterTrickCard(&_selectedCard, 0);
-												return;
-											}
-										}
-										actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										for (int k = 0; k <= 7; k++) {
-											if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) {
-												playCounterTrickCard(&_selectedCard, 3);
-												return;
-											}
-										}
-										actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										for (int k = 0; k <= 7; k++) {
-											if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) {
-												playCounterTrickCard(&_selectedCard, 1);
-												return;
-											}
+							playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard);
+							return;
+						}
+					} else {
+						if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) {
+							if (_selectedCard._cardId == 13) {
+								if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									for (int k = 0; k <= 7; k++) {
+										if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) {
+											playCounterTrickCard(&_selectedCard, 0);
+											return;
 										}
-										actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else {
-										actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 									}
-								} else if (_selectedCard._cardId == 25) {
-									if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										if ( (_gameBoardSide[0]._handCard[0]._cardId != 0)
-											|| (_gameBoardSide[0]._handCard[1]._cardId != 0)
-											|| (_gameBoardSide[0]._handCard[2]._cardId != 0)
-											|| (_gameBoardSide[0]._handCard[3]._cardId != 0) ) {
-												int k;
-												for (k = 0; k <= 3; k++){
-													if (_gameBoardSide[2]._handCard[k]._cardId == 0)
-														break;
-												}
-												playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0);
-												return;
-										} else {
-											actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-										}
-									} else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										if ( (_gameBoardSide[1]._handCard[0]._cardId != 0)
-											|| (_gameBoardSide[1]._handCard[1]._cardId != 0)
-											|| (_gameBoardSide[1]._handCard[2]._cardId != 0)
-											|| (_gameBoardSide[1]._handCard[3]._cardId != 0) ) {
-												int k;
-												for (k = 0; k <= 3; k++){
-													if (_gameBoardSide[2]._handCard[k]._cardId == 0)
-														break;
-												}
-												playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1);
-												return;
-										} else {
-											actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									for (int k = 0; k <= 7; k++) {
+										if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) {
+											playCounterTrickCard(&_selectedCard, 3);
+											return;
 										}
 									}
-
-									if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-										if ( (_gameBoardSide[3]._handCard[0]._cardId != 0)
-											|| (_gameBoardSide[3]._handCard[1]._cardId != 0)
-											|| (_gameBoardSide[3]._handCard[2]._cardId != 0)
-											|| (_gameBoardSide[3]._handCard[3]._cardId != 0) ) {
-												int k;
-												for (k = 0; k <= 3; k++){
-													if (_gameBoardSide[2]._handCard[k]._cardId == 0)
-														break;
-												}
-												playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3);
-												return;
-										} else {
-											actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									for (int k = 0; k <= 7; k++) {
+										if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) {
+											playCounterTrickCard(&_selectedCard, 1);
+											return;
 										}
-									} else {
-										actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 									}
-								} else if (_selectedCard._cardId == 29) {
-									actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-								} else if (_selectedCard._cardId == 27) {
-									actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else {
+									actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 								}
-							} else {
-								if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-									if (_gameBoardSide[0]._delayCard._cardId != 0) {
-										actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else if (!isAttackPossible(0, _selectedCard._cardId)) {
-										switch (_selectedCard._cardId) {
-										case 10:
-											actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 12:
-											actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 15:
-											actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 17:
-											actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 18:
-											actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 19:
-											actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 20:
-											actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 21:
-											actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										default:
-											break;
-										}
+							} else if (_selectedCard._cardId == 25) {
+								if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									if ( (_gameBoardSide[0]._handCard[0]._cardId != 0)
+										|| (_gameBoardSide[0]._handCard[1]._cardId != 0)
+										|| (_gameBoardSide[0]._handCard[2]._cardId != 0)
+										|| (_gameBoardSide[0]._handCard[3]._cardId != 0) ) {
+											int k;
+											for (k = 0; k <= 3; k++){
+												if (_gameBoardSide[2]._handCard[k]._cardId == 0)
+													break;
+											}
+											playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0);
+											return;
 									} else {
-										playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard);
-										return;
+										actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 									}
-								} else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-									if (_gameBoardSide[3]._delayCard._cardId != 0) {
-										actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else if (!isAttackPossible(3, _selectedCard._cardId)) {
-										switch (_selectedCard._cardId) {
-										case 10:
-											actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 12:
-											actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 15:
-											actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 17:
-											actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 18:
-											actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 19:
-											actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 20:
-											actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 21:
-											actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										default:
-											break;
-										}
+								} else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									if ( (_gameBoardSide[1]._handCard[0]._cardId != 0)
+										|| (_gameBoardSide[1]._handCard[1]._cardId != 0)
+										|| (_gameBoardSide[1]._handCard[2]._cardId != 0)
+										|| (_gameBoardSide[1]._handCard[3]._cardId != 0) ) {
+											int k;
+											for (k = 0; k <= 3; k++){
+												if (_gameBoardSide[2]._handCard[k]._cardId == 0)
+													break;
+											}
+											playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1);
+											return;
 									} else {
-										playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard);
-										return;
+										actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 									}
-								} else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
-									if (_gameBoardSide[1]._delayCard._cardId != 0) {
-										actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-									} else if (!isAttackPossible(1, _selectedCard._cardId)) {
-										switch (_selectedCard._cardId) {
-										case 10:
-											actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 12:
-											actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 15:
-											actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 17:
-											actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 18:
-											actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 19:
-											actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 20:
-											actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										case 21:
-											actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-											break;
-										default:
-											break;
-										}
+								}
+
+								if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+									if ( (_gameBoardSide[3]._handCard[0]._cardId != 0)
+										|| (_gameBoardSide[3]._handCard[1]._cardId != 0)
+										|| (_gameBoardSide[3]._handCard[2]._cardId != 0)
+										|| (_gameBoardSide[3]._handCard[3]._cardId != 0) ) {
+											int k;
+											for (k = 0; k <= 3; k++){
+												if (_gameBoardSide[2]._handCard[k]._cardId == 0)
+													break;
+											}
+											playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3);
+											return;
 									} else {
-										playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard);
-										return;
+										actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									}
+								} else {
+									actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								}
+							} else if (_selectedCard._cardId == 29) {
+								actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+							} else if (_selectedCard._cardId == 27) {
+								actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+							}
+						} else {
+							if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+								if (_gameBoardSide[0]._delayCard._cardId != 0) {
+									actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else if (!isAttackPossible(0, _selectedCard._cardId)) {
+									switch (_selectedCard._cardId) {
+									case 10:
+										actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 12:
+										actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 15:
+										actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 17:
+										actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 18:
+										actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 19:
+										actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 20:
+										actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 21:
+										actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									default:
+										break;
+									}
+								} else {
+									playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard);
+									return;
+								}
+							} else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+								if (_gameBoardSide[3]._delayCard._cardId != 0) {
+									actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else if (!isAttackPossible(3, _selectedCard._cardId)) {
+									switch (_selectedCard._cardId) {
+									case 10:
+										actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 12:
+										actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 15:
+										actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 17:
+										actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 18:
+										actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 19:
+										actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 20:
+										actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 21:
+										actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									default:
+										break;
+									}
+								} else {
+									playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard);
+									return;
+								}
+							} else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+								if (_gameBoardSide[1]._delayCard._cardId != 0) {
+									actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+								} else if (!isAttackPossible(1, _selectedCard._cardId)) {
+									switch (_selectedCard._cardId) {
+									case 10:
+										actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 12:
+										actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 15:
+										actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 17:
+										actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 18:
+										actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 19:
+										actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 20:
+										actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									case 21:
+										actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+										break;
+									default:
+										break;
 									}
 								} else {
-									actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+									playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard);
+									return;
 								}
+							} else {
+								actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 							}
 						}
 					}


Commit: 7798c68512aa768069b4de050aef0fe7e1a05fc6
    https://github.com/scummvm/scummvm/commit/7798c68512aa768069b4de050aef0fe7e1a05fc6
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-22T04:11:12-08:00

Commit Message:
TSAGE: R2R - Scene 1337 - optimize game logic based on board behavior

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 f471293..1869eea 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -5569,9 +5569,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 				actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 				break;
 			}
-			found = true;
-			break;
-		} else if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) {
+			return;
+		}
+		if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) {
 			switch (_gameBoardSide[0]._outpostStation[i]._cardId) {
 			case 0:
 				actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
@@ -5580,9 +5580,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 				actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 				break;
 			}
-			found = true;
-			break;
-		} else if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) {
+			return;
+		}
+		if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) {
 			switch (_gameBoardSide[1]._outpostStation[i]._cardId) {
 			case 0:
 				actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
@@ -5591,9 +5591,9 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 				actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117);
 				break;
 			}
-			found = true;
-			break;
-		} else if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) {
+			return;
+		}
+		if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) {
 			switch (_gameBoardSide[3]._outpostStation[i]._cardId) {
 			case 0:
 				actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
@@ -5602,61 +5602,54 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 				actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172);
 				break;
 			}
-			found = true;
-			break;
+			return;
 		}
 	}
 
 	if (_gameBoardSide[2]._delayCard.isIn(pt)) {
 		// The original uses _gameBoardSide[0], which is obviously a bug.
-		if (_gameBoardSide[2]._delayCard._cardId != 0) {
+		if (_gameBoardSide[2]._delayCard._cardId != 0)
 			actionDisplay(1330, 39, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-		} else {
+		else
 			actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-		}
-		found = true;
-	}
 
+		return;
+	}
 	if (_gameBoardSide[3]._delayCard.isIn(pt)) {
-		if (_gameBoardSide[3]._delayCard._cardId != 0) {
+		if (_gameBoardSide[3]._delayCard._cardId != 0)
 			actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172);
-		} else {
+		else
 			actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
-		}
-		found = true;
-	}
 
+		return;
+	}
 	if (_gameBoardSide[1]._delayCard.isIn(pt)) {
-		if (_gameBoardSide[1]._delayCard._cardId != 0) {
+		if (_gameBoardSide[1]._delayCard._cardId != 0)
 			actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117);
-		} else {
+		else
 			actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
-		}
-		found = true;
-	}
 
+		return;
+	}
 	if (_gameBoardSide[0]._delayCard.isIn(pt)) {
-		if (_gameBoardSide[0]._delayCard._cardId != 0) {
+		if (_gameBoardSide[0]._delayCard._cardId != 0)
 			actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-		} else {
+		else
 			actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-		}
-		found = true;
-	}
 
+		return;
+	}
 	if (_gameBoardSide[3]._emptyStationPos.isIn(pt)) {
 		actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
-		found = true;
+		return;
 	}
-
 	if (_gameBoardSide[1]._emptyStationPos.isIn(pt)) {
 		actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
-		found = true;
+		return;
 	}
-
 	if (_gameBoardSide[0]._emptyStationPos.isIn(pt)) {
 		actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-		found = true;
+		return;
 	}
 
 	if (found)


Commit: 4ec63a6da189ee28890a8e891d39c04aa3f61eb0
    https://github.com/scummvm/scummvm/commit/4ec63a6da189ee28890a8e891d39c04aa3f61eb0
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-22T04:11:13-08:00

Commit Message:
TSAGE: R2R - Remove dead code in scene 1100 and 1850

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 1869eea..cb4d745 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -1202,18 +1202,10 @@ void Scene1100::signal() {
 		R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
 		if (_nextStripNum == 0) {
 			R2_GLOBALS.setFlag(55);
-			if (R2_GLOBALS.getFlag(55)) {
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN)
-					_stripManager.start(318, this);
-				else
-					_stripManager.start(323, this);
-			} else {
-				// This part is totally useless as flag 55 has been set right before the check
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN)
-					_stripManager.start(317, this);
-				else
-					_stripManager.start(322, this);
-			}
+			if (R2_GLOBALS._player._characterIndex == R2_QUINN)
+				_stripManager.start(318, this);
+			else
+				_stripManager.start(323, this);
 		} else
 			_stripManager.start3(_nextStripNum, this, _stripManager._lookupList);
 
@@ -11910,28 +11902,14 @@ void Scene1850::postInit(SceneObjectList *OwnerList) {
 				_screen.setPosition(Common::Point(122, 113));
 				_screen.fixPriority(114);
 				_screen._effect = EFFECT_SHADED2;
-
-				// Totally useless test
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
-					_screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
-				} else {
-					// And the associated dead code
-					_screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
-				}
+				_screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
 
 				_helmet.postInit();
 				_helmet.setup(1853, 3, 2);
 				_helmet.setPosition(Common::Point(139, 111));
 				_helmet.fixPriority(114);
 				_helmet._effect = EFFECT_SHADED2;
-
-				// Still totally useless test
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
-					_helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL);
-				} else {
-					// Another piece of dead code
-					_helmet.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
-				}
+				_helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL);
 
 				if (R2_GLOBALS.getFlag(31)) {
 					_screen._shade = 0;
@@ -11954,28 +11932,14 @@ void Scene1850::postInit(SceneObjectList *OwnerList) {
 				_screen.setPosition(Common::Point(122, 113));
 				_screen.fixPriority(114);
 				_screen._effect = EFFECT_SHADED2;
-
-				// Totally useless test
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
-					// Dead code
-					_screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
-				} else {
-					_screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
-				}
+				_screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
 
 				_helmet.postInit();
 				_helmet.setup(1853, 3, 2);
 				_helmet.setPosition(Common::Point(139, 111));
 				_helmet.fixPriority(114);
 				_helmet._effect = EFFECT_SHADED2;
-
-				// Again, useless test
-				if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
-					// and dead code
-					_helmet.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL);
-				} else {
-					_helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL);
-				}
+				_helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL);
 
 				if (R2_GLOBALS.getFlag(31)) {
 					_screen._shade = 0;


Commit: 8aba76fdadea065b00d87f120b637e4df443505e
    https://github.com/scummvm/scummvm/commit/8aba76fdadea065b00d87f120b637e4df443505e
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-22T04:19:19-08:00

Commit Message:
AVALANCHE: Add a default value in Nim::checkInput()

Changed paths:
    engines/avalanche/nim.cpp



diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
index be32f7c..e4897a6 100644
--- a/engines/avalanche/nim.cpp
+++ b/engines/avalanche/nim.cpp
@@ -359,8 +359,7 @@ bool Nim::checkInput() {
 			}
 		}
 	}
-
-
+	return false;
 }
 
 void Nim::takeSome() {


Commit: 27d1ac113cc194cf16bee7a7e1414961a61f6589
    https://github.com/scummvm/scummvm/commit/27d1ac113cc194cf16bee7a7e1414961a61f6589
Author: Strangerke (strangerke at scummvm.org)
Date: 2013-12-22T06:13:29-08:00

Commit Message:
TSAGE: R2R - Fix a bug after check on _gameBoardSide[0]._delayCard._cardId, some renaming and refactoring

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 cb4d745..8d10810 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -5451,96 +5451,88 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 			default:
 				break;
 			}
-		} else {
-			if ( _gameBoardSide[2]._delayCard.isIn(pt)
+		} else if ( _gameBoardSide[2]._delayCard.isIn(pt)
 			  || _gameBoardSide[0]._delayCard.isIn(pt)
 			  || _gameBoardSide[1]._delayCard.isIn(pt)
 			  || _gameBoardSide[3]._delayCard.isIn(pt) ) {
-				found = true;
+			switch (curReg) {
+			case 5:
+				if (_gameBoardSide[2]._delayCard._cardId != 0)
+					displayDialog(_gameBoardSide[2]._delayCard._cardId);
+				else
+					actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 10:
+				if (_gameBoardSide[3]._delayCard._cardId != 0)
+					displayDialog(_gameBoardSide[3]._delayCard._cardId);
+				else
+					actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 15:
+				if (_gameBoardSide[0]._delayCard._cardId != 0)
+					displayDialog(_gameBoardSide[0]._delayCard._cardId);
+				else
+					actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 20:
+				if (_gameBoardSide[1]._delayCard._cardId != 0)
+					displayDialog(_gameBoardSide[1]._delayCard._cardId);
+				else
+					actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			default:
+				break;
 			}
-
-			if (found) {
-				switch (curReg) {
-				case 5:
-					if (_gameBoardSide[2]._delayCard._cardId != 0)
-						displayDialog(_gameBoardSide[2]._delayCard._cardId);
-					else
-						actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					break;
-				case 10:
-					if (_gameBoardSide[3]._delayCard._cardId != 0)
-						displayDialog(_gameBoardSide[3]._delayCard._cardId);
-					else
-						actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					break;
-				case 15:
-					if (_gameBoardSide[0]._delayCard._cardId != 0)
-						displayDialog(_gameBoardSide[3]._delayCard._cardId);
-					else
-						actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					break;
-				case 20:
-					if (_gameBoardSide[1]._delayCard._cardId != 0)
-						displayDialog(_gameBoardSide[1]._delayCard._cardId);
-					else
-						actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-					break;
-				default:
-					break;
-				}
-			} else {
-				if (_discardPile.isIn(pt)) {
-					if (_discardPile._cardId != 0)
-						displayDialog(_discardPile._cardId);
-					else
-						actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				} else if (_helpIcon._bounds.contains(pt))
-					actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else if (_stockCard.isIn(pt))
-					actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
-					     || (_gameBoardSide[3]._emptyStationPos.isIn(pt))
-					     || (_gameBoardSide[0]._emptyStationPos.isIn(pt))
-					     || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) )
-					actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else if (_gameBoardSide[2]._handCard[0].isIn(pt))
-					displayDialog(_gameBoardSide[2]._handCard[0]._cardId);
-				else if (_gameBoardSide[2]._handCard[1].isIn(pt))
-					displayDialog(_gameBoardSide[2]._handCard[1]._cardId);
-				else if (_gameBoardSide[2]._handCard[2].isIn(pt))
-					displayDialog(_gameBoardSide[2]._handCard[2]._cardId);
-				else if (_gameBoardSide[2]._handCard[3].isIn(pt))
-					displayDialog(_gameBoardSide[2]._handCard[3]._cardId);
-				else if ((curReg >= 6) && (curReg <= 9))
-					actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else if ((curReg >= 11) && (curReg <= 14))
-					actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else if ((curReg >= 16) && (curReg <= 19))
-					actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-				else {
-					switch (curReg) {
-					case 0:
-						actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
-						break;
-					case 5:
-						actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-						break;
-					case 10:
-						actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-						break;
-					case 15:
-						actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-						break;
-					case 20:
-						actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-						break;
-					case 21:
-						actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
-						break;
-					default:
-						break;
-					}
-				}
+		} else if (_discardPile.isIn(pt)) {
+			if (_discardPile._cardId != 0)
+				displayDialog(_discardPile._cardId);
+			else
+				actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		} else if (_helpIcon._bounds.contains(pt))
+			actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else if (_stockCard.isIn(pt))
+			actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
+			     || (_gameBoardSide[3]._emptyStationPos.isIn(pt))
+			     || (_gameBoardSide[0]._emptyStationPos.isIn(pt))
+			     || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) )
+			actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else if (_gameBoardSide[2]._handCard[0].isIn(pt))
+			displayDialog(_gameBoardSide[2]._handCard[0]._cardId);
+		else if (_gameBoardSide[2]._handCard[1].isIn(pt))
+			displayDialog(_gameBoardSide[2]._handCard[1]._cardId);
+		else if (_gameBoardSide[2]._handCard[2].isIn(pt))
+			displayDialog(_gameBoardSide[2]._handCard[2]._cardId);
+		else if (_gameBoardSide[2]._handCard[3].isIn(pt))
+			displayDialog(_gameBoardSide[2]._handCard[3]._cardId);
+		else if ((curReg >= 6) && (curReg <= 9))
+			actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else if ((curReg >= 11) && (curReg <= 14))
+			actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else if ((curReg >= 16) && (curReg <= 19))
+			actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+		else {
+			switch (curReg) {
+			case 0:
+				actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
+				break;
+			case 5:
+				actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 10:
+				actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 15:
+				actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 20:
+				actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			case 21:
+				actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+				break;
+			default:
+				break;
 			}
 		}
 	}
@@ -5644,9 +5636,6 @@ void Scene1337::handleClick(int arg1, Common::Point pt) {
 		return;
 	}
 
-	if (found)
-		return;
-
 	if (_helpIcon._bounds.contains(pt)) {
 		showOptionsDialog();
 		return;
@@ -5733,20 +5722,19 @@ void Scene1337::handlePlayer0() {
 		}
 	}
 
-	int tmpVal;
 	for (int i = 0; i <= 3; i++) {
-		tmpVal = getStationId(0, i);
+		int tmpVal = getStationId(0, i);
 
 		if (tmpVal != -1) {
-			bool flag = false;
+			bool stationAlreadyPresentFl = false;
 			for (int j = 0; j <= 7; j++) {
 				if (_gameBoardSide[0]._outpostStation[j]._cardId == _gameBoardSide[0]._handCard[tmpVal]._cardId) {
-					flag = true;
+					stationAlreadyPresentFl = true;
 					break;
 				}
 			}
 
-			if (!flag) {
+			if (!stationAlreadyPresentFl) {
 				for (int j = 0; j <= 7; j++) {
 					if ((_gameBoardSide[0]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) {
 						int stationCount = 0;
@@ -5767,7 +5755,7 @@ void Scene1337::handlePlayer0() {
 		}
 	}
 
-	tmpVal = findPlatformCardInHand(0);
+	int tmpVal = findPlatformCardInHand(0);
 
 	if (tmpVal != -1) {
 		for (int i = 0; i <= 7; i++) {
@@ -5816,28 +5804,27 @@ void Scene1337::handlePlayer0() {
 		}
 	}
 
-	tmpVal = findCard13InHand(0);
-	int tmpVal2 = getPlayerWithOutpost(0);
+	card13Id = findCard13InHand(0);
+	int victimPlayerId = getPlayerWithOutpost(0);
 
-	if ((tmpVal != -1) && (tmpVal2 != -1)) {
-		playCounterTrickCard(&_gameBoardSide[0]._handCard[tmpVal], tmpVal2);
+	if ((card13Id != -1) && (victimPlayerId != -1)) {
+		playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], victimPlayerId);
 		return;
 	}
 
-	tmpVal = checkThieftCard(0);
-	if (tmpVal != -1) {
+	thieftId = checkThieftCard(0);
+	if (thieftId != -1) {
 		if ( (_gameBoardSide[1]._handCard[0]._cardId != 0)
 		  || (_gameBoardSide[1]._handCard[1]._cardId != 0)
 		  || (_gameBoardSide[1]._handCard[2]._cardId != 0)
 		  || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) {
-			playThieftCard(0, &_gameBoardSide[0]._handCard[tmpVal], 1);
+			playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 1);
 			return;
 		}
 	}
 
 	for (int i = 0; i <= 3; i++) {
-		tmpVal = getStationCardId(_gameBoardSide[0]._handCard[i]._cardId);
-		if (tmpVal != -1) {
+		if (getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) {
 			if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) {
 				playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard);
 				return;
@@ -6482,6 +6469,7 @@ void Scene1337::handlePlayer2() {
 									actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 								}
 							} else if (_selectedCard._cardId == 29) {
+								// Interceptor cards are used to prevent collision
 								actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154);
 							} else if (_selectedCard._cardId == 27) {
 								actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154);






More information about the Scummvm-git-logs mailing list