From f19b8a88d55da6326058b70d89872fd063ae5c95 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 27 Mar 2012 14:48:36 -0400 Subject: [PATCH] Fixed issue with Disarm never working. --- src/main/java/com/gmail/nossr50/Combat.java | 2 +- src/main/java/com/gmail/nossr50/skills/Unarmed.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index a9a5755c5..b1952b3a3 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -100,7 +100,7 @@ public class Combat { } if (targetType.equals(EntityType.PLAYER) && mcPermissions.getInstance().disarm(attacker)) { - Unarmed.disarmProcCheck(PPa, (Player) target); + Unarmed.disarmProcCheck(attacker, (Player) target); } startGainXp(attacker, PPa, target, SkillType.UNARMED, plugin); diff --git a/src/main/java/com/gmail/nossr50/skills/Unarmed.java b/src/main/java/com/gmail/nossr50/skills/Unarmed.java index 7849b7ada..4ca45b90d 100644 --- a/src/main/java/com/gmail/nossr50/skills/Unarmed.java +++ b/src/main/java/com/gmail/nossr50/skills/Unarmed.java @@ -43,13 +43,13 @@ public class Unarmed { * @param PPa Profile of the attacking player * @param defender The defending player */ - public static void disarmProcCheck(PlayerProfile PPa, Player defender) { + public static void disarmProcCheck(Player attacker, Player defender) { final int MAX_BONUS_LEVEL = 1000; - int skillLevel = PPa.getSkillLevel(SkillType.UNARMED); + int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.UNARMED); int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL); - if (defender.getItemInHand().getType().equals(Material.AIR)) { + if (attacker.getItemInHand().equals(Material.AIR)) { if (random.nextInt(3000) <= skillCheck) { ItemStack item = defender.getItemInHand();