fix debuff and buff not using new operator usage properly

This commit is contained in:
Jrc13245
2025-12-10 08:49:50 -05:00
parent b36416f38a
commit 8d7b9086d9
2 changed files with 24 additions and 8 deletions
+6 -6
View File
@@ -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)
+18 -2
View File
@@ -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