From 0fcc197ada29d57003e00429af8d0f7f860ba99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 7 Mar 2016 09:11:22 +0100 Subject: BattleCommon: getWinner() first check if one player has no more units --- core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 6 +++--- 1 file 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); -- cgit v1.1-2-g2b99