diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/map')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map1Units.java | 7 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map2Moves.java | 3 |
2 files changed, 4 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java index c018d56..3aa0c8d 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java @@ -38,10 +38,9 @@ public abstract class Map1Units extends Map0Hex public int collectMoveable(Unit unit) { + activableUnits.clear(); if (unit.canHQMove()) collectMoveAssists(unit, activableUnits.asPawns()); - else - activableUnits.clear(); if (unit.canMove()) activableUnits.add(unit); @@ -51,15 +50,15 @@ public abstract class Map1Units extends Map0Hex public int collectTargets(Unit unit, UnitList foes) { + targetUnits.clear(); if (unit.canEngage()) return collectPossibleTargets(unit, foes.asPawns(), targetUnits.asPawns()); - - targetUnits.clear(); return 0; } public int collectAssists(Unit unit, Unit target, UnitList units) { + activableUnits.clear(); int s = collectAttackAssists(unit, target, units.asPawns(), activableUnits.asPawns()); activatedUnits.add(unit); return s; diff --git a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java index 4f87971..e7ba8ce 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java @@ -45,10 +45,9 @@ public abstract class Map2Moves extends Map1Units public int movesCollect(Unit unit) { + moves.clear(); if (unit.canMove()) return collectPossibleMoves(unit, moves); - - moves.clear(); return 0; } |