Fix up the event messaging

This commit is contained in:
2024-10-14 18:21:39 +02:00
parent 623977ccef
commit 0ce3b54169
3 changed files with 17 additions and 13 deletions

View File

@@ -52,9 +52,14 @@ function(allstates, e, prefix, msg, ...)
end
if not prefix or prefix ~= aura_env.addonprefix then return end
local name, threat, note = strsplit(aura_env.separator, msg)
print("threat", threat)
threat = tonumber(threat)
local parts = {}
for part in string.gmatch(msg, "([^" .. aura_env.separator .. "]+)") do
table.insert(parts, part)
end
local name = parts[1]
local threat = tonumber(parts[2])
local note = parts[3]
if not name then
if aura_env.config.debug then
print(string.format("Could not get name for %s (%s) with deliminer '%s'", msg, name or "nil", aura_env.separator))