From 2a4734f258b31fa15dba730c4f80e25b20bc3dde Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Tue, 6 Jan 2026 15:04:51 -0500 Subject: [PATCH] update nampower for copy use in cached table references --- NampowerAPI.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/NampowerAPI.lua b/NampowerAPI.lua index 342cd60..b17a326 100644 --- a/NampowerAPI.lua +++ b/NampowerAPI.lua @@ -439,7 +439,12 @@ function API.GetSpellRecord(spellId, copy) end -- Copy parameter requires v2.20+ - local useCopy = copy and API.features.hasCopyParameter and copy or nil + -- When caching (not copy), also request copy=1 if available for safe storage + -- This prevents issues with Nampower's table reuse + local useCopy = nil + if API.features.hasCopyParameter then + useCopy = copy or 1 -- Use caller's copy value, or 1 for caching + end -- Use native function if GetSpellRec then @@ -710,7 +715,12 @@ function API.GetItemRecord(itemId, copy) end -- Copy parameter requires v2.20+ - local useCopy = copy and API.features.hasCopyParameter and copy or nil + -- When caching (not copy), also request copy=1 if available for safe storage + -- This prevents issues with Nampower's table reuse + local useCopy = nil + if API.features.hasCopyParameter then + useCopy = copy or 1 -- Use caller's copy value, or 1 for caching + end -- Use native function if GetItemStats then