Clean up the log messages a little

This commit is contained in:
2025-01-02 11:02:56 +01:00
parent 6ef7e74402
commit d4bab870a4
2 changed files with 6 additions and 2 deletions

View File

@@ -69,6 +69,9 @@ function shared.Spotter.Init()
local maxHp = UnitHealthMax(unit)
if not maxHp then return string.format("Could not find maxHp for unit %s", tostring(unit)) end
local class = UnitClass(unit)
if not class then return string.format("Could not find class for unit %s", tostring(unit)) end
local location = Heimdall_Data.config.spotter.zoneOverride
if not location then
local zone = GetZoneText()
@@ -79,10 +82,11 @@ function shared.Spotter.Init()
end
local stinky = Heimdall_Data.config.stinkies[name] or false
local text = string.format("I see (%s) %s %s of race %s (%s) with health %s/%s at %s",
local text = string.format("I see (%s) %s/%s %s of race %s (%s) with health %s/%s at %s",
hostile and "Hostile" or "Friendly",
stinky and string.format("(%s)", "!!!!") or "",
name,
class,
race,
faction,
FormatHP(hp),