From b62d397c2e561086ecd1adfc05299e30f6546324 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Thu, 16 Jul 2020 19:31:08 -0700 Subject: [PATCH] Fixed bug where item data initialization would read data outside bounds --- core/src/com/riiablo/save/ItemData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/riiablo/save/ItemData.java b/core/src/com/riiablo/save/ItemData.java index 4761030c..1c57b2a8 100644 --- a/core/src/com/riiablo/save/ItemData.java +++ b/core/src/com/riiablo/save/ItemData.java @@ -286,7 +286,7 @@ public class ItemData { IntArray inventoryItems = getStore(StoreLoc.INVENTORY); cache = inventoryItems.items; - for (int i = 0, s = cache.length, j; i < s; i++) { + for (int i = 0, s = inventoryItems.size, j; i < s; i++) { j = cache[i]; if (j == INVALID_ITEM) continue; Item item = itemData.get(j);