From 25fed51523e39fab816bb4c8955e90fe09c4b2c2 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 28 Mar 2024 21:06:57 -0500 Subject: [PATCH] canRoll work --- src/engine/objects/NPC.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);