aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-10-13 08:28:45 +0200
committerStrangerke2014-10-13 08:28:45 +0200
commit84c8e966bddcaa32b0602270beb68c08c0b59088 (patch)
tree7f2234b32bd3c663b9c9fc4e17a8bec774ef1f6d
parent78accfa64783332cecb80d62753266a25abc6021 (diff)
downloadscummvm-rg350-84c8e966bddcaa32b0602270beb68c08c0b59088.tar.gz
scummvm-rg350-84c8e966bddcaa32b0602270beb68c08c0b59088.tar.bz2
scummvm-rg350-84c8e966bddcaa32b0602270beb68c08c0b59088.zip
TSAGE: R2R - Some refactoring in Scene1337::Action12
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index cf611090a0..8c960f47e1 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -4293,7 +4293,8 @@ void Scene1337::Action12::signal() {
scene->_selectedCard._stationPos = event.mousePos;
- if (scene->_actionPlayerIdx == 0) {
+ switch (scene->_actionPlayerIdx) {
+ case 0:
for (i = 0; i <= 3; i++) {
if (scene->_gameBoardSide[0]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)) {
found = true;
@@ -4301,42 +4302,44 @@ void Scene1337::Action12::signal() {
break;
}
}
- }
-
- if (scene->_actionPlayerIdx == 3) {
+ break;
+ case 1:
for (i = 0; i <= 3; i++) {
- if (scene->_gameBoardSide[3]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)) {
+ if (scene->_gameBoardSide[1]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)) {
found = true;
- scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[i];
+ scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[i];
break;
}
}
- }
-
- if (scene->_actionPlayerIdx == 1) {
+ break;
+ case 3:
for (i = 0; i <= 3; i++) {
- if (scene->_gameBoardSide[1]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)) {
+ if (scene->_gameBoardSide[3]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)) {
found = true;
- scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[i];
+ scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[i];
break;
}
}
+ break;
+ default:
+ break;
}
}
scene->subC4CEC();
- } else if (scene->_actionPlayerIdx != 1) {
+ } else {
switch (scene->_actionPlayerIdx) {
case 0:
scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getRandomCardFromHand(0)];
break;
+ case 1:
+ scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getRandomCardFromHand(1)];
+ break;
case 3:
scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getRandomCardFromHand(3)];
break;
default:
break;
}
- } else {
- scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getRandomCardFromHand(1)];
}
scene->_actionCard1->_card.postInit();