- don't mess with the faction thingy when in combat.

This commit is contained in:
ckknight
2008-07-16 17:34:39 +00:00
parent 6ce1c593e4
commit 109d2ad889

View File

@ -102,10 +102,15 @@ local function FigureZone(unit)
end
end
local should_UPDATE_FACTION = false
local in_UNIT_FACTION = false
local function UPDATE_FACTION()
if in_UNIT_FACTION then return end
in_UNIT_FACTION = true
if InCombatLockdown() then
should_UPDATE_FACTION = true
return
end
for i = 1, GetNumFactions() do
local name,_,_,_,_,_,_,_,isHeader,isCollapsed = GetFactionInfo(i)
if isHeader == 1 then
@ -127,6 +132,12 @@ local function UPDATE_FACTION()
end
DogTag:AddEventHandler("Unit", "UPDATE_FACTION", UPDATE_FACTION)
DogTag:AddEventHandler("Unit", "PLAYER_LOGIN", UPDATE_FACTION)
DogTag:AddEventHandler("Unit", "PLAYER_REGEN_ENABLED", function()
if should_UPDATE_FACTION then
should_UPDATE_FACTION = false
UPDATE_FACTION()
end
end)
DogTag:AddTag("Unit", "Guild", {
code = function(unit)