summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-07 09:11:22 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-07 09:11:22 +0100
commit0fcc197ada29d57003e00429af8d0f7f860ba99b (patch)
tree1b9b44e4a64c5360ae064485371bb498094b0615
parentfde84c4f717543e38e4c3367ef0ed259ad09166c (diff)
downloadRustAndDust-0fcc197ada29d57003e00429af8d0f7f860ba99b.zip
RustAndDust-0fcc197ada29d57003e00429af8d0f7f860ba99b.tar.gz
BattleCommon: getWinner() first check if one player has no more units
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index 56c0801..e046628 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -161,9 +161,6 @@ public abstract class BattleCommon implements Battle
protected Player getWinner(int minTurns)
{
- if (!turnDoneForBoth())
- return null;
-
Player a = players[0];
Player b = players[1];
@@ -175,6 +172,9 @@ public abstract class BattleCommon implements Battle
if (a.getTurn() <= minTurns)
return null;
+ if (!turnDoneForBoth())
+ return null;
+
a.objectivesWon = map.objectivesCount(a.army);
b.objectivesWon = map.objectivesCount(b.army);