From fe99043b4b7e2dc847b5884820e34b359f779fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 21 Dec 2015 21:16:56 +0100 Subject: PathBuilder: choosePath: clears it all and then add the choosen path --- core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 12 ++++++------ 1 file 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; -- cgit v1.1-2-g2b99