Browse Source

Logic cleanup

combat-2
MagicBot 8 months ago
parent
commit
784767dc4e
  1. 9
      src/engine/objects/ItemTemplate.java

9
src/engine/objects/ItemTemplate.java

@ -530,7 +530,11 @@ public class ItemTemplate {
if (itemManager == null || abstractCharacter == null) if (itemManager == null || abstractCharacter == null)
return false; return false;
if (abstractCharacter.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { // Early exit for mobiles and NPCS.
// Perhaps not needed now that mobs have skills.
if (EnumSet.of(Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(abstractCharacter.getObjectType()))
return false;
if (!validForSlot(slot, itemManager.getEquipped(), item)) if (!validForSlot(slot, itemManager.getEquipped(), item))
return false; return false;
@ -546,7 +550,4 @@ public class ItemTemplate {
return item.template.item_value != 0 || Kit.IsNoobGear(item.getItemBase().uuid); return item.template.item_value != 0 || Kit.IsNoobGear(item.getItemBase().uuid);
} }
return true; //Mobiles and NPC's don't need to check equip
}
} }

Loading…
Cancel
Save