mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-21 23:26:56 +00:00
Hook the real global _G.UnitHealth for feign death
Inside a RegisterModule body, `function UnitHealth(...)` defines UnitHealth on the pfUI environment, not the real global -- so the feign-death real-HP fix only reached callers that resolve UnitHealth through pfUI's env, and missed _G consumers (Blizzard frames, other addons). Hook _G.UnitHealth explicitly (and capture oldUnitHealth from _G) so the un-gate applies everywhere.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
pfUI:RegisterModule("feigndeath", function ()
|
||||
local oldUnitHealth = UnitHealth
|
||||
function UnitHealth(unit)
|
||||
local oldUnitHealth = _G.UnitHealth
|
||||
_G.UnitHealth = function(unit)
|
||||
if UnitIsFeignDeath(unit) then
|
||||
local hp = GetUnitField(unit, "health")
|
||||
if hp and hp > 0 then return hp end
|
||||
|
||||
Reference in New Issue
Block a user