From de427be595c6b4edbc71db9f4215d47eae888d29 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Sat, 27 Dec 2025 18:48:10 -0500 Subject: [PATCH] fix nampower load error --- Conditionals.lua | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index 3d4de70..290a246 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -195,19 +195,23 @@ local function BuildEquipmentCache() for nampowerSlot, itemInfo in pairs(result) do -- Nampower uses 0-indexed slots, WoW API uses 1-indexed -- tonumber() handles both string and numeric keys from different Nampower versions - local slot = tonumber(nampowerSlot) + 1 - -- itemInfo must be a table to access .itemId (userdata from some Nampower versions is not indexable) - if slot >= 1 and slot <= 19 and type(itemInfo) == "table" and itemInfo.itemId then - _equippedItemIDs[slot] = itemInfo.itemId - usedNampower = true + -- Skip non-numeric keys (metadata fields, etc.) + local slotNum = tonumber(nampowerSlot) + if slotNum and type(itemInfo) == "table" and itemInfo.itemId then + local slot = slotNum + 1 + -- itemInfo must be a table to access .itemId (userdata from some Nampower versions is not indexable) + if slot >= 1 and slot <= 19 then + _equippedItemIDs[slot] = itemInfo.itemId + usedNampower = true - -- Get item name via Nampower API or GetItemInfo - local itemName = API and API.GetItemName and API.GetItemName(itemInfo.itemId) - if not itemName then - itemName = GetItemInfo(itemInfo.itemId) - end - if itemName then - _equippedItemNames[slot] = string_lower(itemName) + -- Get item name via Nampower API or GetItemInfo + local itemName = API and API.GetItemName and API.GetItemName(itemInfo.itemId) + if not itemName then + itemName = GetItemInfo(itemInfo.itemId) + end + if itemName then + _equippedItemNames[slot] = string_lower(itemName) + end end end end