From 5695210afbd448f9b6013223a7c10215288b5ec0 Mon Sep 17 00:00:00 2001 From: "fxpw(Toxa)" <84588274+fxpw@users.noreply.github.com> Date: Mon, 30 Oct 2023 09:44:08 +0300 Subject: [PATCH] fix imports from new wa versions --- WeakAuras/GenericTrigger.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 4fef0af..835649e 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -211,14 +211,18 @@ function ConstructTest(trigger, arg) test = "("..arg.test:format(tostring(trigger[name]) or "")..")"; elseif(arg.type == "longstring" and trigger[name.."_operator"]) then test = TestForLongString(trigger, arg); - elseif (arg.type == "string" or arg.type == "select" or arg.type == "item") then + elseif (arg.type == "string" or arg.type == "select" or arg.type == "item") and not (type(trigger[name]) == "table") then test = "(".. name .." and "..name.."==" ..(number or "\""..(trigger[name] or "").."\"")..")"; else - if(type(trigger[name]) == "table") then - trigger[name] = "error"; - end - -- number - test = "(".. name .." and "..name..(trigger[name.."_operator"] or "==")..(number or "\""..(trigger[name] or "").."\"")..")"; + -- if (type(trigger[name]) == "table") or type(trigger[name.."_operator"]) == "table" then + -- 3.4.0 auras fix + if (type(trigger[name]) == "table") then + trigger[name] = trigger[name][1] or "error"; + end + if (type(trigger[name.."_operator"]) == "table") then + trigger[name.."_operator"] = trigger[name.."_operator"][1] or "error"; + end + test = "(".. name .." and "..name..(trigger[name.."_operator"] or "==")..(number or ("\""..(trigger[name])) or ("".."\""))..")"; end end