From 0e951d7089e34305deb2c7ebb9447a99b3efda28 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Sun, 26 Jan 2025 18:13:53 +0100 Subject: [PATCH] Fix naming in minimaptagger --- Modules/MinimapTagger.lua | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Modules/MinimapTagger.lua b/Modules/MinimapTagger.lua index 1beb9cb..4a14bee 100644 --- a/Modules/MinimapTagger.lua +++ b/Modules/MinimapTagger.lua @@ -347,24 +347,28 @@ function shared.MinimapTagger.Init() local chatFrame = CreateFrame("Frame") chatFrame:RegisterEvent("CHAT_MSG_CHANNEL") chatFrame:SetScript("OnEvent", function(self, event, msg, sender, ...) - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) - -- end + --if Heimdall_Data.config.echoer.debug then + -- print(string.format("[%s] Channel message received from: %s", ModuleName, sender)) + --end if not Heimdall_Data.config.minimapTagger.enabled then - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) - -- end + --if Heimdall_Data.config.echoer.debug then + -- print(string.format("[%s] Module disabled, ignoring message", ModuleName)) + --end return end local channelId = select(6, ...) local _, channelname = GetChannelName(channelId) - -- if Heimdall_Data.config.echoer.debug then - -- print(string.format("[%s] Processing message from channel: %s", ModuleName, channelname)) - -- end + local ok = false + for _, channel in pairs(Heimdall_Data.config.minimapTagger.channels) do + if channelname == channel then + ok = true + break + end + end - if channelname ~= Heimdall_Data.config.minimapTagger.masterChannel then + if not ok then if Heimdall_Data.config.minimapTagger.debug then print(string.format("[%s] Ignoring message from non-master channel: %s, need %s", ModuleName, channelname, Heimdall_Data.config.minimapTagger.masterChannel)) @@ -384,7 +388,7 @@ function shared.MinimapTagger.Init() if currentMapId ~= messageMapId then if Heimdall_Data.config.minimapTagger.debug then print(string.format("[%s] Current map ID (%d) does not match message map ID (%d), ignoring message", - ModuleName, currentMapId, messageMapId)) + ModuleName, currentMapId, messageMapId)) end doTag = false end