From 011ceea598905b3519fdce9c4a5d86cc2bc7ef09 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Tue, 11 Mar 2025 15:57:57 -0500 Subject: [PATCH] fix rolling bug --- src/engine/objects/ItemFactory.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/objects/ItemFactory.java b/src/engine/objects/ItemFactory.java index 928d4055..d84fa103 100644 --- a/src/engine/objects/ItemFactory.java +++ b/src/engine/objects/ItemFactory.java @@ -681,8 +681,12 @@ public class ItemFactory { } Random random = new Random(); - prefixMod = vendor.getModTypeTable().get(random.nextInt(vendor.getModTypeTable().size())); - suffixMod = vendor.getModSuffixTable().get(random.nextInt(vendor.getModTypeTable().size())); + for (byte temp : vendor.getItemModTable()) { + if (itemModTable != temp) + continue; + prefixMod = vendor.getModTypeTable().get(vendor.getItemModTable().indexOf(temp)); + suffixMod = vendor.getModSuffixTable().get(vendor.getItemModTable().indexOf(temp)); + } if (prefixMod == 0 && suffixMod == 0) { Logger.info("Failed to find modTables for item " + ib.getName());