mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-28 05:35:45 +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
|
@Override
|
||||||
public boolean onCancel(AI ai, CancelReason reason) {
|
public boolean onCancel(AI ai, CancelReason reason) {
|
||||||
|
if (hackfix) {
|
||||||
|
hackfix = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
hackfix = false;
|
||||||
if (executing && reason == CancelReason.REPLACE) {
|
if (executing && reason == CancelReason.REPLACE) {
|
||||||
executing = false;
|
executing = false;
|
||||||
return false;
|
return false;
|
||||||
@ -52,7 +59,9 @@ public class GenericWaypointCallback extends NavigationCallback {
|
|||||||
if (dest == null && itr.hasNext())
|
if (dest == null && itr.hasNext())
|
||||||
dest = itr.next().getLocation();
|
dest = itr.next().getLocation();
|
||||||
if (dest != null) {
|
if (dest != null) {
|
||||||
|
hackfix = true;
|
||||||
ai.setDestination(dest);
|
ai.setDestination(dest);
|
||||||
|
hackfix = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user