mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Read HP deficit via ClassicAPI UnitHealthMissing
ValidateHpLost now gets the health deficit in one call through CleveRoids.ClassicAPI.UnitHealthMissing, mirroring how ValidatePowerLost uses UnitPowerMissing, instead of hand-computing max - current via NampowerAPI.
This commit is contained in:
+1
-4
@@ -3399,10 +3399,7 @@ end
|
||||
-- returns: True or false
|
||||
function CleveRoids.ValidateHpLost(unit, operator, amount)
|
||||
if not unit or not operator or not amount then return false end
|
||||
local API = CleveRoids.NampowerAPI
|
||||
local maxHp = API and API.GetUnitMaxHealth and API.GetUnitMaxHealth(unit) or UnitHealthMax(unit)
|
||||
local hp = API and API.GetUnitHealth and API.GetUnitHealth(unit) or UnitHealth(unit)
|
||||
local hpLost = maxHp - hp
|
||||
local hpLost = CleveRoids.ClassicAPI.UnitHealthMissing(unit)
|
||||
|
||||
if CleveRoids.operators[operator] then
|
||||
return CleveRoids.comparators[operator](hpLost, amount)
|
||||
|
||||
Reference in New Issue
Block a user