Fix a multiworld issue in LookClose

This commit is contained in:
fullwall 2012-05-25 23:02:20 +08:00
parent c5e95eb667
commit 32445afec6

View File

@ -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;
}