From 045b101d7bc3d82deb2f684b496dbaa6e130f034 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 28 Mar 2024 03:59:22 -0400 Subject: [PATCH] Bypass for mobiles in def logic --- src/engine/objects/AbstractCharacter.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/objects/AbstractCharacter.java b/src/engine/objects/AbstractCharacter.java index e7d26c63..b36b1f88 100644 --- a/src/engine/objects/AbstractCharacter.java +++ b/src/engine/objects/AbstractCharacter.java @@ -945,26 +945,29 @@ public abstract class AbstractCharacter extends AbstractWorldObject { if (armor == null) return 0; - ItemTemplate ib = armor.template; + ItemTemplate template = armor.template; - if (ib == null) + if (template == null) return 0; if (!armor.template.item_type.equals(ItemType.ARMOR)) return 0; if (armor.template.item_skill_used.isEmpty()) - return ib.item_defense_rating; + return template.item_defense_rating; CharacterSkill armorSkill = abstractCharacter.skills.get(armor.template.item_skill_used); if (abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) && armorSkill == null) { Logger.error("Player " + abstractCharacter.getObjectUUID() + " has armor equipped without the nescessary skill to equip it"); - return ib.item_defense_rating; + return template.item_defense_rating; } - float def = ib.item_defense_rating; + if (armorSkill == null) + return template.item_defense_rating; // Mobiles do not have armor skills @TODO + + float def = template.item_defense_rating; //apply item defense bonuses