Fix naming in commander

This commit is contained in:
2025-01-26 18:04:19 +01:00
parent 19f9d4bda9
commit 9b755cd0be

View File

@@ -268,22 +268,32 @@ function shared.Commander.Init()
local commanderChannelFrame = CreateFrame("Frame")
commanderChannelFrame:RegisterEvent("CHAT_MSG_CHANNEL")
commanderChannelFrame:SetScript("OnEvent", function(self, event, msg, sender, ...)
-- if Heimdall_Data.config.commander.debug then
--if Heimdall_Data.config.commander.debug then
-- print(string.format("[%s] Event received", ModuleName))
-- shared.dumpTable(Heimdall_Data.config.commander)
-- end
--end
if not Heimdall_Data.config.commander.enabled then
-- if Heimdall_Data.config.commander.debug then
--if Heimdall_Data.config.commander.debug then
-- print(string.format("[%s] Module disabled, ignoring event", ModuleName))
-- end
--end
return
end
local channelId = select(6, ...)
local _, channelname = GetChannelName(channelId)
-- if Heimdall_Data.config.commander.debug then
-- print(string.format("[%s] Channel received: %s", ModuleName, channelname))
-- end
if channelname ~= Heimdall_Data.config.commander.masterChannel then return end
local ok = false
for _, channel in pairs(Heimdall_Data.config.commander.channels) do
if channel == channelname then
ok = true
break
end
end
if not ok then
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Channel name does not match any of the channels", ModuleName))
end
return
end
sender = string.match(sender, "^[^-]+")
if Heimdall_Data.config.commander.debug then
print(string.format("[%s] Message from: %s", ModuleName, sender))