From 8d7b9086d9ca77792f749e1422d42100fdcaeac2 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Wed, 10 Dec 2025 08:49:50 -0500 Subject: [PATCH] fix debuff and buff not using new operator usage properly --- Conditionals.lua | 12 ++++++------ Core.lua | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index 52fcff3..946081e 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -2104,9 +2104,9 @@ CleveRoids.Keywords = { if type(conditionals.mod) ~= "table" then return CleveRoids.kmods.mod() end - return Or(conditionals.mod, function(mod) + return Multi(conditionals.mod, function(mod) return CleveRoids.kmods[mod]() - end) + end, conditionals, "mod") end, nomod = function(conditionals) @@ -2451,9 +2451,9 @@ CleveRoids.Keywords = { end, buff = function(conditionals) - return Or(conditionals.buff, function(v) + return Multi(conditionals.buff, function(v) return CleveRoids.ValidateUnitBuff(conditionals.target, v) - end) + end, conditionals, "buff") end, nobuff = function(conditionals) @@ -2463,9 +2463,9 @@ CleveRoids.Keywords = { end, debuff = function(conditionals) - return Or(conditionals.debuff, function(v) + return Multi(conditionals.debuff, function(v) return CleveRoids.ValidateUnitDebuff(conditionals.target, v) - end) + end, conditionals, "debuff") end, nodebuff = function(conditionals) diff --git a/Core.lua b/Core.lua index 5ad6931..7fbd1bd 100644 --- a/Core.lua +++ b/Core.lua @@ -2437,9 +2437,25 @@ function CleveRoids.DoUse(msg) return end - -- Simple bag scan and equip - no cache, no Nampower API (causes crashes) + -- Search equipped inventory slots first (for trinkets, etc.) local qname = string_lower(msg) + for slot = 0, 19 do + local link = GetInventoryItemLink("player", slot) + if link then + local _, _, nm = string_find(link, "|h%[(.-)%]|h") + if nm and string_lower(nm) == qname then + if CleveRoids.equipDebugLog then + CleveRoids.Print("|cff888888[UseLog] /use " .. msg .. " via UseInventoryItem(" .. slot .. ")|r") + end + ClearCursor() + UseInventoryItem(slot) + return + end + end + end + + -- Then search bags - no cache, no Nampower API (causes crashes) for bag = 0, 4 do local numSlots = GetContainerNumSlots(bag) or 0 for bagSlot = 1, numSlots do @@ -2459,7 +2475,7 @@ function CleveRoids.DoUse(msg) end if CleveRoids.equipDebugLog then - CleveRoids.Print("|cff888888[EquipLog] /equip " .. msg .. " - not found in bags (already equipped?)|r") + CleveRoids.Print("|cff888888[UseLog] /use " .. msg .. " - not found in equipped slots or bags|r") end end