From 8c39ede85247c6c2c5d835f0d0ff16424c009f6b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 28 Mar 2024 21:02:06 -0500 Subject: [PATCH] canRoll work --- src/engine/objects/NPC.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 929881dc..a7d357b5 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -1067,8 +1067,9 @@ public class NPC extends AbstractCharacter { ItemTemplate itemTemplate; for (Integer itemID : fullItemList) { itemTemplate = ItemTemplate.templates.get(itemID); - boolean exclude = itemTemplate.item_skill_required.values().iterator().next() == 0 && ItemTemplate.templates.get(itemID).item_type.equals(ItemType.WEAPON); - if (itemTemplate.item_skill_required.values().iterator().next() <= maxSkill && !exclude) + int 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); } if (this.contract.getVendorID() == 102) {