mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 11:38:26 +01:00
Hackfix a stack overflow problem.
This commit is contained in:
parent
de5edc19ad
commit
e3d553e0d7
@ -41,8 +41,15 @@ public class GenericWaypointCallback extends NavigationCallback {
|
||||
}
|
||||
}
|
||||
|
||||
boolean hackfix = false;
|
||||
|
||||
@Override
|
||||
public boolean onCancel(AI ai, CancelReason reason) {
|
||||
if (hackfix) {
|
||||
hackfix = false;
|
||||
return false;
|
||||
}
|
||||
hackfix = false;
|
||||
if (executing && reason == CancelReason.REPLACE) {
|
||||
executing = false;
|
||||
return false;
|
||||
@ -52,7 +59,9 @@ public class GenericWaypointCallback extends NavigationCallback {
|
||||
if (dest == null && itr.hasNext())
|
||||
dest = itr.next().getLocation();
|
||||
if (dest != null) {
|
||||
hackfix = true;
|
||||
ai.setDestination(dest);
|
||||
hackfix = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user