Quantcast

Fix for the currency datatext when on a neutral character.

Michael Tindal [12-14-14 - 20:02]
Fix for the currency datatext when on a neutral character.
Filename
ElvUI_SLE/modules/sledatatexts/currency.lua
diff --git a/ElvUI_SLE/modules/sledatatexts/currency.lua b/ElvUI_SLE/modules/sledatatexts/currency.lua
index 7b4bf9f..ebba0c2 100644
--- a/ElvUI_SLE/modules/sledatatexts/currency.lua
+++ b/ElvUI_SLE/modules/sledatatexts/currency.lua
@@ -23,7 +23,6 @@ local DungeonRaid = { 776, 752, 697, 738, 615, 614, 395, 396 }
 local PvPPoints = { 390, 392, 391 }
 local MiscellaneousCurrency = { 241, 416, 515, 777, 823, 824 }

-local _, Faction = UnitFactionGroup('player')
 local HordeColor = RAID_CLASS_COLORS['DEATHKNIGHT']
 local AllianceColor = RAID_CLASS_COLORS['SHAMAN']

@@ -187,8 +186,12 @@ local function OnEvent(self, event, ...)

 		self.text:SetText(FormatMoney(NewMoney))

+		local FactionToken, Faction = UnitFactionGroup('player')
+
 		ElvDB['gold'][E.myrealm][E.myname] = NewMoney
-		ElvDB['faction'][E.myrealm][Faction][E.myname] = NewMoney
+		if (FactionToken ~= "Neutral") then
+			ElvDB['faction'][E.myrealm][Faction][E.myname] = NewMoney
+		end
 	end

 	if event == 'PLAYER_ENTERING_WORLD' or event == 'SPELLS_CHANGED' then