diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-31 02:19:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-31 02:19:13 +0100 |
commit | 76e3ea905df73b2645189bb2540918103e34eb10 (patch) | |
tree | 65e7c81dc3fd663b629885178533d4e4dbd6d503 /core/src/ch/asynk | |
parent | d61c311e9b5fe196a4f99d31e929783f6a5d6770 (diff) | |
download | RustAndDust-76e3ea905df73b2645189bb2540918103e34eb10.zip RustAndDust-76e3ea905df73b2645189bb2540918103e34eb10.tar.gz |
Move.TileIterator: fix so that we can pass over the target and come back
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Move.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Move.java b/core/src/ch/asynk/rustanddust/engine/Move.java index 3ff7c54..34797b8 100644 --- a/core/src/ch/asynk/rustanddust/engine/Move.java +++ b/core/src/ch/asynk/rustanddust/engine/Move.java @@ -23,7 +23,7 @@ public class Move extends Path implements Iterable<Vector3> @Override public boolean hasNext() { - if (tile == move.to) + if (i == move.tiles.size()) return false; return true; } @@ -31,7 +31,7 @@ public class Move extends Path implements Iterable<Vector3> @Override public Tile next() { - if (tile == move.to) + if (!hasNext()) throw new java.util.NoSuchElementException(); if (tile != null) { |