summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/game/states/StateReplay.java4
1 files changed, 3 insertions, 1 deletions
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();