Forever Combat Nameplates: the realm's answer counts whatever shape the sender's realm part has (Name-Realm or Name Realm)

This commit is contained in:
Karrz1
2026-11-16 22:04:37 +00:00
parent 4d5a9f00db
commit 234aaf60bb
@@ -114,8 +114,10 @@ local function ownReply(channel, sender)
local me = UnitName("player")
if isSecret(me) or not me then return false end
if sender == me then return true end
local realm = GetNormalizedRealmName and GetNormalizedRealmName()
return realm and sender == me .. "-" .. realm
-- The realm part comes in different shapes ("Name-Realm", "Name-RealmNoSpaces", or "Name Realm" on some clients);
-- character names never hold a space or a hyphen, so the part before the first one is the name.
local name = sender:match("^([^%s%-]+)")
return name == me
end
events:RegisterEvent("ADDON_LOADED")