From 177517c2681d25e3bd0c3f710c90398c8e304160 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Mon, 14 Oct 2024 00:04:36 +0200 Subject: [PATCH] More betterer race detection hopefully --- FreshShit/StinkyDetector/event.lua | 7 +++++++ FreshShit/StinkyDetector/init.lua | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/FreshShit/StinkyDetector/event.lua b/FreshShit/StinkyDetector/event.lua index d64d026..1b4152e 100644 --- a/FreshShit/StinkyDetector/event.lua +++ b/FreshShit/StinkyDetector/event.lua @@ -35,6 +35,13 @@ function(allstates, e, ...) if UnitIsPlayer("nameplate" .. i) then local name = UnitName("nameplate" .. i) local faction = UnitFactionGroup("nameplate" .. i) + local _, race = UnitRace("nameplate" .. i) + local raceFaction = aura_env.raceFactions[race] + if not raceFaction then + print("Unknown race faction", race) + else + faction = raceFaction + end WeakAurasSaved.Cyka.PlayerFactionCache[name] = faction end end diff --git a/FreshShit/StinkyDetector/init.lua b/FreshShit/StinkyDetector/init.lua index cdd90b6..b221d44 100644 --- a/FreshShit/StinkyDetector/init.lua +++ b/FreshShit/StinkyDetector/init.lua @@ -36,6 +36,22 @@ WeakAurasSaved.Cyka.Stinkies = { ["Zawaz"] = nil, ["Totleta"] = nil, } + +aura_env.raceFactions = { + ["Orc"] = "Horde", + ["Undead"] = "Horde", + ["Tauren"] = "Horde", + ["Troll"] = "Horde", + ["BloodElf"] = "Horde", + ["Goblin"] = "Horde", + ["Human"] = "Alliance", + ["Dwarf"] = "Alliance", + ["NightElf"] = "Alliance", + ["Gnome"] = "Alliance", + ["Draenei"] = "Alliance", + ["Worgen"] = "Alliance", +} + local toNotify = { "Succpotato", "Extazyk", "Smokefire", "Smokemantra", "Хихихантер", "Муркот", "Растафаркрай" } -- local toNotify = { "Succpotato" } aura_env.whisperQueue = {}