diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-07 09:11:22 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-07 09:11:22 +0100 |
commit | 0fcc197ada29d57003e00429af8d0f7f860ba99b (patch) | |
tree | 1b9b44e4a64c5360ae064485371bb498094b0615 /core/src | |
parent | fde84c4f717543e38e4c3367ef0ed259ad09166c (diff) | |
download | RustAndDust-0fcc197ada29d57003e00429af8d0f7f860ba99b.zip RustAndDust-0fcc197ada29d57003e00429af8d0f7f860ba99b.tar.gz |
BattleCommon: getWinner() first check if one player has no more units
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 6 |
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); |