Fix inputs overrides not resetting when out of world, fixes #43

This commit is contained in:
Brady 2018-08-21 16:36:51 -05:00
parent 8ee65f1212
commit a9cac7718e
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 4 additions and 3 deletions

View File

@ -56,8 +56,7 @@ public class PathingBehavior extends Behavior {
@Override @Override
public void onTick(TickEvent event) { public void onTick(TickEvent event) {
if (event.getType() == TickEvent.Type.OUT) { if (event.getType() == TickEvent.Type.OUT) {
current = null; this.cancel();
next = null;
return; return;
} }
if (current == null) { if (current == null) {
@ -148,7 +147,9 @@ public class PathingBehavior extends Behavior {
return current; return current;
} }
public PathExecutor getNext() {return next;} public PathExecutor getNext() {
return next;
}
public Optional<IPath> getPath() { public Optional<IPath> getPath() {
return Optional.ofNullable(current).map(PathExecutor::getPath); return Optional.ofNullable(current).map(PathExecutor::getPath);