From e11b8b0817607e96b80df87c66afa9c197d90f25 Mon Sep 17 00:00:00 2001 From: ips-ux Date: Mon, 19 Jan 2026 12:46:12 -0700 Subject: [PATCH] Fix factioncolor tag GetUnitBattlefieldFaction error (#97) Fixed error: "attempt to call method 'GetUnitBattlefieldFaction' (a nil value)" at Tags.lua:838 Changes: - Changed E:GetUnitBattlefieldFaction(unit) to call the global API function directly - Added nil check for GetUnitBattlefieldFaction in case it's not available - Added fallback to UnitFactionGroup(unit) for compatibility The issue was that the code was trying to call GetUnitBattlefieldFaction as a method on the E object (E:GetUnitBattlefieldFaction), but this method doesn't exist. The fix calls the WoW API function directly with a proper nil check and fallback to ensure the tag works in all cases. Fixes #TBD --- ElvUI/Core/Tags.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElvUI/Core/Tags.lua b/ElvUI/Core/Tags.lua index 3db695b..b212295 100644 --- a/ElvUI/Core/Tags.lua +++ b/ElvUI/Core/Tags.lua @@ -835,7 +835,7 @@ do } E:AddTag('factioncolor', 'UNIT_NAME_UPDATE UNIT_FACTION', function(unit) - local englishFaction = E:GetUnitBattlefieldFaction(unit) + local englishFaction = (GetUnitBattlefieldFaction and GetUnitBattlefieldFaction(unit)) or UnitFactionGroup(unit) return factionColors[englishFaction or ''] end) end