From 06cf0ff2c2c39b380c9e00ae00592cf5717ac9f2 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 24 Jan 2013 23:03:00 -0500 Subject: [PATCH] Temporary fix for some of our combat checks not being called properly. A better fix will be coming soon. --- .../java/com/gmail/nossr50/skills/Combat.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/Combat.java b/src/main/java/com/gmail/nossr50/skills/Combat.java index c02d9d2b5..88d0ffc4a 100644 --- a/src/main/java/com/gmail/nossr50/skills/Combat.java +++ b/src/main/java/com/gmail/nossr50/skills/Combat.java @@ -56,9 +56,9 @@ public class Combat { boolean targetIsPlayer = (target.getType() == EntityType.PLAYER); boolean targetIsTamedPet = (target instanceof Tameable) ? ((Tameable) target).isTamed() : false; - switch (damager.getType()) { + switch (event.getDamager().getType()) { case PLAYER: - Player attacker = (Player) damager; + Player attacker = (Player) event.getDamager(); if (Misc.isNPCPlayer(attacker)) { return; @@ -133,7 +133,7 @@ public class Combat { break; case WOLF: - Wolf wolf = (Wolf) damager; + Wolf wolf = (Wolf) event.getDamager(); if (wolf.isTamed() && wolf.getOwner() instanceof Player) { Player master = (Player) wolf.getOwner(); @@ -158,7 +158,7 @@ public class Combat { break; case ARROW: - LivingEntity shooter = ((Arrow) damager).getShooter(); + LivingEntity shooter = ((Arrow) event.getDamager()).getShooter(); //TODO: Is there a reason we're breaking here instead of returning? if (shooter == null || shooter.getType() != EntityType.PLAYER) { @@ -184,10 +184,10 @@ public class Combat { if (targetIsPlayer) { Player player = (Player) target; - if (damager instanceof Player) { + if (event.getDamager() instanceof Player) { if (Swords.pvpEnabled) { SwordsManager swordsManager = new SwordsManager(player); - swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage()); + swordsManager.counterAttackChecks((LivingEntity) event.getDamager(), event.getDamage()); } if (Acrobatics.pvpEnabled) { @@ -201,13 +201,13 @@ public class Combat { } } else { - if (Swords.pveEnabled && damager instanceof LivingEntity) { + if (Swords.pveEnabled && event.getDamager() instanceof LivingEntity) { SwordsManager swordsManager = new SwordsManager(player); - swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage()); + swordsManager.counterAttackChecks((LivingEntity) event.getDamager(), event.getDamage()); } if (Acrobatics.pveEnabled) { - if (!(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled)) { + if (!(event.getDamager() instanceof LightningStrike && Acrobatics.dodgeLightningDisabled)) { AcrobaticsManager acrobaticsManager = new AcrobaticsManager(player); acrobaticsManager.dodgeCheck(event); }