Fix a multiworld issue in LookClose

This commit is contained in:
fullwall 2012-05-25 23:02:20 +08:00
parent 6cd9401a41
commit e3fb3704b5

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