Files
pfUI/modules/feigndeath.lua
T
Brues d62a1222df feigndeath: use UnitIsFeignDeath + GetUnitField, drop tooltip cache
ClassicAPI's UnitIsFeignDeath reads UNIT_FIELD_FLAGS bit 29 directly —
the authoritative server flag, no detection guesswork needed. Combined
with Nampower's GetUnitField("health"), we read live HP off the
descriptor instead of caching the moment-of-death healthbar value via
libtipscan.

Drops the name-keyed cache, the UNIT_HEALTH / PLAYER_TARGET_CHANGED
event handlers, and the tooltip scanner. Also fixes the staleness bug
where a feigning hunter taking further damage kept showing the cached
snapshot from when feign first triggered — live read updates with
every UnitHealth call now.
2026-06-24 22:49:43 -05:00

11 lines
282 B
Lua

pfUI:RegisterModule("feigndeath", function ()
local oldUnitHealth = UnitHealth
function UnitHealth(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)