summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-28 17:56:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-28 17:56:43 +0100
commitaecdc3c1d331c774650ed17013c8143a73717aaf (patch)
tree1959f298994acfa59156fbd2ef5f629c984a5b5a /core/src/ch/asynk
parent02bd9c7afcde4a6518a5b9efdc4033318a305e3d (diff)
downloadRustAndDust-aecdc3c1d331c774650ed17013c8143a73717aaf.zip
RustAndDust-aecdc3c1d331c774650ed17013c8143a73717aaf.tar.gz
PathIterator: throws java.util.NoSuchElementException when needed
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathIterator.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathIterator.java b/core/src/ch/asynk/rustanddust/engine/PathIterator.java
index 53f2f82..8a56729 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathIterator.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathIterator.java
@@ -41,6 +41,9 @@ public class PathIterator implements Iterator<Vector3>
@Override
public Vector3 next()
{
+ if (!hasNext())
+ throw new java.util.NoSuchElementException();
+
if (tile == to) {
v.z = orientation.r();
o = orientation;