Files
pfUI/modules/feigndeath.lua
T
Brues 7df4aa6d50 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.
2026-07-25 00:32:44 -05:00

11 lines
290 B
Lua

pfUI:RegisterModule("feigndeath", function ()
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
end
return oldUnitHealth(unit)
end
end)