summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-21 21:16:56 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-21 21:16:56 +0100
commitfe99043b4b7e2dc847b5884820e34b359f779fbd (patch)
tree063fe5bacd39262b5e50a44928a061b03a4acfb9 /core/src
parent04159917bc94e04ad96c5b2a2012045f7e6adb58 (diff)
downloadRustAndDust-fe99043b4b7e2dc847b5884820e34b359f779fbd.zip
RustAndDust-fe99043b4b7e2dc847b5884820e34b359f779fbd.tar.gz
PathBuilder: choosePath: clears it all and then add the choosen path
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java12
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;