From 5fbb7e7d4ed73165acd1a6868134ac6d7c9e9acc Mon Sep 17 00:00:00 2001 From: Vincentyification Date: Thu, 2 Jan 2014 13:35:47 +0800 Subject: [PATCH] Resistance Discounting Fix a variable name, and added a continue statement for efficiency --- .../gmail/nossr50/skills/acrobatics/AcrobaticsManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java index 407c105d3..b1e4d7991 100644 --- a/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java +++ b/src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java @@ -151,17 +151,17 @@ public class AcrobaticsManager extends SkillManager { } private boolean isFatal(double damage) { - Player player = getPlayer(); int discount=1; // If the player has resistance active, carry resistance checking - if(player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){ - Iterator potions=t.getActivePotionEffects().iterator(); + if(getPlayer().hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE)){ + Iterator potions=getPlayer().getActivePotionEffects().iterator(); while(potions.hasNext()){ PotionEffect potion=(PotionEffect)potions.next(); if(potion.getType()==PotionEffectType.DAMAGE_RESISANCE) {//Having resistance allows you to recieve less damage int coupon=potion.getAmplifier(); discount=Math.min(0,1-(coupon*0.2)); + continue; } } }//...Which is accounted here