From 2cf23ab8607903783930c600b18b287452f57d18 Mon Sep 17 00:00:00 2001 From: Phanx Date: Fri, 18 Nov 2016 14:25:59 -0800 Subject: [PATCH] Fix error in RESURRECT_REQUEST in raids Resolves #13 --- LibResInfo-1.0.lua | 15 ++++++++------- LibResInfo-1.0.toc | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/LibResInfo-1.0.lua b/LibResInfo-1.0.lua index 589dfbe..c5df41b 100644 --- a/LibResInfo-1.0.lua +++ b/LibResInfo-1.0.lua @@ -19,7 +19,7 @@ local DEBUG_FRAME = ChatFrame3 ------------------------------------------------------------------------ -local MAJOR, MINOR = "LibResInfo-1.0", 24 +local MAJOR, MINOR = "LibResInfo-1.0", 25 assert(LibStub, MAJOR.." requires LibStub") assert(LibStub("CallbackHandler-1.0", true), MAJOR.." requires CallbackHandler-1.0") local lib, oldminor = LibStub:NewLibrary(MAJOR, MINOR) @@ -207,8 +207,9 @@ end -- * All returns are nil if no res is being cast on the unit. -- * resType is one of: -- - SELFRES if the unit has a Soulstone or other self-res ability available, --- - PENDING if the unit already has a res available to accept, or --- - CASTING if a res is being cast on the unit. +-- - PENDING if the unit already has a res available to accept, +-- - CASTING if a res is being cast on the unit, or +-- - MASSRES if a mass res is being cast. -- * caster and casterGUID are nil if the unit is being mass-ressed. ------------------------------------------------------------------------ @@ -575,7 +576,7 @@ function eventFrame:RESURRECT_REQUEST(event, casterName) callbacks:Fire("LibResInfo_MassResFinished", unitFromGUID[caster], caster) end - local target = guidFromUnit.player + local target = UnitGUID("player") -- guidFromUnit["player"] will be nil in a raid local endTime = GetTime() + RESURRECT_PENDING_TIME hasPending[target] = endTime @@ -584,12 +585,12 @@ function eventFrame:RESURRECT_REQUEST(event, casterName) debug(1, ">> ResPending", "on", nameFromGUID[target], "by", nameFromGUID[caster]) callbacks:Fire("LibResInfo_ResPending", "player", target, endTime) - -- UNIT_FLAGS doesn't fire for the player after he accepts a resurrect after releasing - self:RegisterEvent('UNIT_HEALTH') + -- UNIT_FLAGS doesn't fire for the player when accepting a resurrect after releasing + self:RegisterEvent("UNIT_HEALTH") end function eventFrame:UNIT_HEALTH(event, unit) - local guid = guidFromUnit[unit] + local guid = unit and guidFromUnit[unit] -- UNIT_HEALTH can fire with nil unit in 7.1 if hasPending[guid] and not UnitIsDeadOrGhost(unit) then hasPending[guid] = nil debug(1, ">> ResUsed", nameFromGUID[guid]) diff --git a/LibResInfo-1.0.toc b/LibResInfo-1.0.toc index fa1dd69..b1f79e8 100644 --- a/LibResInfo-1.0.toc +++ b/LibResInfo-1.0.toc @@ -1,5 +1,5 @@ -## Interface: 70000 -## Version: @project-revision@ +## Interface: 70100 +## Version: @project-version@ ## Title: Lib: ResInfo-1.0 ## Notes: Library to provide information about resurrections in your group. @@ -21,4 +21,4 @@ Libs\LibStub\LibStub.lua Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua -LibResInfo-1.0.lua \ No newline at end of file +LibResInfo-1.0.lua