1
0
Fork 0

Getting player GUID every time

This commit is contained in:
pigmonkey 2011-06-05 20:26:39 -04:00
parent 0177b5934b
commit d1dd3898aa

View file

@ -119,7 +119,6 @@ function mod:ZONE_CHANGED_NEW_AREA()
end
end
local pid = UnitGUID("player")
function mod:COMBAT_LOG_EVENT_UNFILTERED(_, _, event, _, ...)
if not enabled or not combatEvents[event] then return end
@ -131,7 +130,7 @@ function mod:COMBAT_LOG_EVENT_UNFILTERED(_, _, event, _, ...)
end
-- source is player
if pid ~= srcGUID then return end
if UnitGUID("player") ~= srcGUID then return end
local category = spellWatch[spellId]
if category then
@ -148,10 +147,11 @@ function mod:COMBAT_LOG_EVENT_UNFILTERED(_, _, event, _, ...)
end
function mod:UNIT_SPELLCAST_SUCCEEDED(_, unit, _, _, _, spellId)
if not enabled or UnitGUID(unit) ~= pid then return end
if not enabled or UnitGUID(unit) ~= UnitGUID("player") then return end
local category = spellWatch[spellId]
if category then
-- self:Print("UNIT_SPELLCAST_SUCCEEDED", category, spellId)
if not auras[category] then
local duration = durations[category]
if not duration then
@ -169,6 +169,8 @@ function mod:SpellStart(category, endTime)
local time = GetTime()
if not icon or endTime<time then return end
-- self:Print("Start", category, endTime-GetTime())
lastAvailable[category] = nil
local duration = endTime - time
icon.cooldown = duration
@ -180,6 +182,8 @@ function mod:SpellStop(category, nocd)
local icon = icons[category]
if not icon then return end
-- self:Print("Stop", category)
lastAvailable[category] = GetTime()
icon.cooldown = 0
if not nocd then