From 5278b42d55ed8fc0e65d2aec329ff139851e060a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 29 Mar 2016 16:47:32 +0200 Subject: StateReplay: fix selectedUnit --- core/src/ch/asynk/rustanddust/game/states/StateReplay.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/rustanddust/game/states/StateReplay.java b/core/src/ch/asynk/rustanddust/game/states/StateReplay.java index 19c9e42..013ca65 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateReplay.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateReplay.java @@ -23,9 +23,11 @@ public class StateReplay extends StateCommon private void setup() { + int s = order.activable.size(); + switch (order.type) { case MOVE: - selectedUnit = order.activable.get(order.activable.size() - 1); + selectedUnit = ((s > 0) ? order.activable.get(s - 1) : order.unit); break; case ENGAGE: to = order.engagement.defender.getHex(); -- cgit v1.1-2-g2b99