mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
more fixes for heal predictions
more fixes for heal predictions
This commit is contained in:
+16
-7
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user