diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index a7d357b5..9da64b4f 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -1065,9 +1065,13 @@ public class NPC extends AbstractCharacter { break; } ItemTemplate itemTemplate; + int skillRequired = 0; for (Integer itemID : fullItemList) { itemTemplate = ItemTemplate.templates.get(itemID); - int skillRequired = itemTemplate.item_skill_required.values().iterator().next(); + + if(itemTemplate.item_skill_required.values().iterator().hasNext()) + skillRequired = itemTemplate.item_skill_required.values().iterator().next(); + boolean exclude = skillRequired == 0 && ItemTemplate.templates.get(itemID).item_type.equals(ItemType.WEAPON); if (skillRequired <= maxSkill && !exclude) filteredItemList.add(itemID);