mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-24 08:36:04 +00:00
7df4aa6d50
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.
11 lines
290 B
Lua
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)
|