From e3d553e0d73720a12d66ac67436251e8cada49e3 Mon Sep 17 00:00:00 2001 From: fullwall Date: Mon, 11 Jun 2012 16:11:54 +0800 Subject: [PATCH] Hackfix a stack overflow problem. --- .../trait/waypoint/GenericWaypointCallback.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/net/citizensnpcs/trait/waypoint/GenericWaypointCallback.java b/src/main/java/net/citizensnpcs/trait/waypoint/GenericWaypointCallback.java index b27693054..dda6807a8 100644 --- a/src/main/java/net/citizensnpcs/trait/waypoint/GenericWaypointCallback.java +++ b/src/main/java/net/citizensnpcs/trait/waypoint/GenericWaypointCallback.java @@ -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; }