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());