From 18a4f5ed40bb76320f9a5dbb141b755b70e389fd Mon Sep 17 00:00:00 2001 From: GJ Date: Fri, 25 Jan 2013 17:57:42 -0500 Subject: [PATCH] Fixed bug where Iron Grip was using the attacker's skill values rather than the defender's --- Changelog.txt | 1 + .../com/gmail/nossr50/skills/unarmed/UnarmedManager.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 0c2d6a7a8..6a40e7747 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -23,6 +23,7 @@ Version 1.4.00-dev = Fixed Leaf Blower not respecting the unlock level set in advanced.yml = Fixed abilities activating with the wrong tool in hand = Fixed Experience.Gains.Mobspawners.Enabled not being used correctly (the check was inverted) + = Fixed bug where Iron Grip was using the attacker's skill values rather than the defender's. ! Changed how Berserk handles not picking up items to avoid listening to PlayerPickupItemEvent ! Moved Hylian Luck into a separate listener since it actually cancels the event and shouldn't just be on MONITOR. ! Changed how Tree Feller is handled, it should now put less stress on the CPU diff --git a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java index 9387a0682..003c766e3 100644 --- a/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java +++ b/src/main/java/com/gmail/nossr50/skills/unarmed/UnarmedManager.java @@ -84,10 +84,9 @@ public class UnarmedManager extends SkillManager { IronGripEventHandler eventHandler = new IronGripEventHandler(this, defender); - float chance = (float) ((Unarmed.ironGripMaxChance / Unarmed.ironGripMaxBonusLevel) * skillLevel); - if (chance > Unarmed.ironGripMaxChance) chance = (float) Unarmed.ironGripMaxChance; + double chance = (Unarmed.ironGripMaxChance / Unarmed.ironGripMaxBonusLevel) * eventHandler.skillModifier; - if (chance > Misc.getRandom().nextInt(activationChance)) { + if (chance > Misc.getRandom().nextInt(Misc.calculateActivationChance(Permissions.luckyUnarmed(defender)))) { eventHandler.sendAbilityMessages(); return true; }