diff options
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java index 50e4e79..e89e237 100644 --- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java +++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java @@ -184,7 +184,11 @@ public class PathBuilder implements Disposable { if (a == null) return b; - if ( (b.fitness > a.fitness) || ((b.fitness == a.fitness) && (b.cost < a.cost))) + if ( (b.fitness > a.fitness) || ( + (b.fitness == a.fitness) && ( + (b.cost < a.cost) || ((b.cost == a.cost) && b.roadMarch && !a.roadMarch) + ) + )) return b; return a; } |