This commit is contained in:
fullwall 2012-10-15 20:31:22 +08:00
parent c3630c1da3
commit c71f226abd
2 changed files with 8 additions and 1 deletions

View File

@ -299,7 +299,12 @@ public class LinearWaypointProvider implements WaypointProvider {
if (selector == null || !event.getNavigator().equals(getNavigator()))
return;
selector.finish();
if (event.getNavigator().getTargetAsLocation().equals(currentDestination.getLocation()))
Location finished = event.getNavigator().getTargetAsLocation();
if (finished == null || currentDestination == null)
return;
if (finished.getWorld() != currentDestination.getLocation().getWorld())
return;
if (finished.equals(currentDestination.getLocation()))
currentDestination.onReach(npc);
}

View File

@ -26,6 +26,8 @@ public class Waypoint {
}
public void onReach(NPC npc) {
if (triggers == null)
return;
for (WaypointTrigger trigger : triggers)
trigger.onWaypointReached(npc, location);
}