Fix a few wolf issues

This commit is contained in:
Wizjany 2013-01-31 08:23:38 -05:00
parent 5085841d9d
commit dfb6114584

View File

@ -337,13 +337,17 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
} else if (attacker instanceof Tameable) { }
if (attacker instanceof Tameable) {
if (((Tameable) attacker).getOwner() == null) { if (((Tameable) attacker).getOwner() == null) {
if (!set.allows(DefaultFlag.MOB_DAMAGE, localPlayer)) { if (!set.allows(DefaultFlag.MOB_DAMAGE, localPlayer)) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
} }
if (!(((Tameable) attacker).getOwner() instanceof Player)) {
return;
}
Player beastMaster = (Player) ((Tameable) attacker).getOwner(); Player beastMaster = (Player) ((Tameable) attacker).getOwner();
Vector pt2 = toVector(attacker.getLocation()); Vector pt2 = toVector(attacker.getLocation());
if (!mgr.getApplicableRegions(pt2).allows(DefaultFlag.PVP, plugin.wrapPlayer(beastMaster))) { if (!mgr.getApplicableRegions(pt2).allows(DefaultFlag.PVP, plugin.wrapPlayer(beastMaster))) {