diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-21 21:16:56 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-21 21:16:56 +0100 |
commit | fe99043b4b7e2dc847b5884820e34b359f779fbd (patch) | |
tree | 063fe5bacd39262b5e50a44928a061b03a4acfb9 | |
parent | 04159917bc94e04ad96c5b2a2012045f7e6adb58 (diff) | |
download | RustAndDust-fe99043b4b7e2dc847b5884820e34b359f779fbd.zip RustAndDust-fe99043b4b7e2dc847b5884820e34b359f779fbd.tar.gz |
PathBuilder: choosePath: clears it all and then add the choosen path
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java index e8435be..518a2d3 100644 --- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java +++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java @@ -133,12 +133,12 @@ public class PathBuilder implements Disposable f = path.fitness; } } - ctrlTiles.clear(); - for (Tile tile : good.tiles) { - toggleCtrlTile(tile); - if (paths.size() == 1) - break; - } + + paths.remove(good); + clearPaths(); + paths.add(good); + for (Tile tile : good.tiles) + tiles.add(tile); } return 1; |