From d61c311e9b5fe196a4f99d31e929783f6a5d6770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 31 Dec 2015 02:13:47 +0100 Subject: PathIterator: fix so that we can pass over the target and come back --- core/src/ch/asynk/rustanddust/engine/PathIterator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/PathIterator.java b/core/src/ch/asynk/rustanddust/engine/PathIterator.java index 8a56729..7feb550 100644 --- a/core/src/ch/asynk/rustanddust/engine/PathIterator.java +++ b/core/src/ch/asynk/rustanddust/engine/PathIterator.java @@ -33,7 +33,7 @@ public class PathIterator implements Iterator @Override public boolean hasNext() { - if ((tile == to) && (o == orientation)) + if ((i > path.size()) && (o == orientation)) return false; return true; } @@ -44,7 +44,7 @@ public class PathIterator implements Iterator if (!hasNext()) throw new java.util.NoSuchElementException(); - if (tile == to) { + if (i > path.size()) { v.z = orientation.r(); o = orientation; return v; -- cgit v1.1-2-g2b99