summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRoger Baumgartner <rogermarcbaumgartner@hotmail.com>2013-08-17 16:13:31 +0200
committerTravis Ralston <travpc@gmail.com>2013-08-26 08:43:51 -0600
commit2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1 (patch)
tree5ce469b5d08713ba92124bb1a0419c5b4f93649c /src
parent6482b6f0bd30c2330e38e8f722921af066a6fc12 (diff)
downloadcraftbukkit-2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1.tar
craftbukkit-2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1.tar.gz
craftbukkit-2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1.tar.lz
craftbukkit-2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1.tar.xz
craftbukkit-2e7f66787dd01e1a5ddaec37c75b54f0f1ee2ce1.zip
Return correct hasLineOfSight value for players. Fixes BUKKIT-4634
Prior to this change when a plugin called Player.hasLineOfSite() the method would always return false because EntityHuman does not extend EntityInsentient. This commit changes that by explicitly checking for line of sight between two entities and returning that value.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index f20c664f..83e0ee9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -329,7 +329,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
public boolean hasLineOfSight(Entity other) {
- return getHandle() instanceof EntityInsentient && ((EntityInsentient) getHandle()).getEntitySenses().canSee(((CraftEntity) other).getHandle());
+ return getHandle().o(((CraftEntity) other).getHandle());
}
public boolean getRemoveWhenFarAway() {