From e3fb3704b559d56d06eebfd9213b4f72bc5e6437 Mon Sep 17 00:00:00 2001 From: fullwall Date: Fri, 25 May 2012 23:02:20 +0800 Subject: [PATCH] Fix a multiworld issue in LookClose --- src/main/java/net/citizensnpcs/trait/LookClose.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/citizensnpcs/trait/LookClose.java b/src/main/java/net/citizensnpcs/trait/LookClose.java index 78a9eb1fd..2fbab0bfd 100644 --- a/src/main/java/net/citizensnpcs/trait/LookClose.java +++ b/src/main/java/net/citizensnpcs/trait/LookClose.java @@ -88,7 +88,8 @@ public class LookClose extends Trait implements Runnable, Toggleable { private boolean hasInvalidTarget() { if (lookingAt == null) return true; - if (!lookingAt.isOnline() || lookingAt.getLocation().distanceSquared(npc.getBukkitEntity().getLocation()) > 5) { + if (!lookingAt.isOnline() || lookingAt.getWorld() != npc.getBukkitEntity().getWorld() + || lookingAt.getLocation().distanceSquared(npc.getBukkitEntity().getLocation()) > 5) { lookingAt = null; return true; }