diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-31 02:13:47 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-31 02:13:47 +0100 |
commit | d61c311e9b5fe196a4f99d31e929783f6a5d6770 (patch) | |
tree | bd0549b2e782356a2073ece13f8548942284158c /core/src | |
parent | 6a9755d1a7b7c7a9445b1235a595f1f46a4548b0 (diff) | |
download | RustAndDust-d61c311e9b5fe196a4f99d31e929783f6a5d6770.zip RustAndDust-d61c311e9b5fe196a4f99d31e929783f6a5d6770.tar.gz |
PathIterator: fix so that we can pass over the target and come back
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/PathIterator.java | 4 |
1 files 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<Vector3> @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<Vector3> if (!hasNext()) throw new java.util.NoSuchElementException(); - if (tile == to) { + if (i > path.size()) { v.z = orientation.r(); o = orientation; return v; |