more fixes for heal predictions

more fixes for heal predictions
This commit is contained in:
Meow
2026-03-03 08:29:00 +01:00
parent c8500efae9
commit f5d2c48933
+16 -7
View File
@@ -209,6 +209,7 @@ pfUI.libdebuff_spell_start_self_hooks["libpredict"] = function(spellId, casterGu
end end
local target = pendingTarget or resolveNameFromGuid(targetGuid) or senttarget or spell_queue[3] local target = pendingTarget or resolveNameFromGuid(targetGuid) or senttarget or spell_queue[3]
libpredict.sender.current_cast = spellName libpredict.sender.current_cast = spellName
libpredict.sender.current_cast_target = target libpredict.sender.current_cast_target = target
@@ -816,15 +817,23 @@ local function UpdateCache(spell, heal, crit)
local heal = heal and tonumber(heal) local heal = heal and tonumber(heal)
if not spell or not heal then return end if not spell or not heal then return end
if not cache[spell] or cache[spell][2] then if not cache[spell] then
-- skills or equipment changed, save whatever is detected -- no cache yet: save whatever we get
cache[spell] = cache[spell] or {} cache[spell] = {}
cache[spell][1] = crit and heal*2/3 or heal cache[spell][1] = crit and heal*2/3 or heal
cache[spell][2] = crit cache[spell][2] = crit
elseif not crit and cache[spell][1] < heal then elseif cache[spell][2] == true then
-- safe the best heal we can get -- flagged as stale (gear/skill change): always overwrite
cache[spell][1] = heal cache[spell][1] = crit and heal*2/3 or heal
cache[spell][2] = nil cache[spell][2] = crit
elseif crit then
-- crit: don't overwrite existing non-crit value
else
-- non-crit: save best value
if cache[spell][1] < heal then
cache[spell][1] = heal
end
cache[spell][2] = false
end end
end end