From 750638d338c30d54cfca4a74d7abb7e7481b14f7 Mon Sep 17 00:00:00 2001 From: Barinade Date: Fri, 23 Jul 2021 20:11:56 -0500 Subject: [PATCH] fix some rescoring issues with negative radar values in eval score usually never returns negative numbers and this hack ensures that if that happens we take from the pss numbers which are right slightly more often but the better solution would instead be to assign the correct radar values instead of -1/-1 in multiplayer because thats the entire reason this change is being made and this makes us depend on pss again in eval which we dont but now we do again --- .../ScreenEvaluation decorations/default.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua index 5bdcf69073..a387f708f0 100644 --- a/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua +++ b/Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua @@ -133,13 +133,25 @@ local judges = { local dvt local totalTaps +local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats() + +-- a helper to get the radar value for a score and fall back to playerstagestats if that fails +-- it tends to fail a lot... +local function gatherRadarValue(radar, score) + local n = score:GetRadarValues():GetValue(radar) + if n == -1 then + return pss:GetRadarActual():GetValue(radar) + end + return n +end + local getRescoreElements = function(score) local o = {} o["dvt"] = dvt - o["totalHolds"] = score:GetRadarPossible():GetValue("RadarCategory_Holds") + score:GetRadarPossible():GetValue("RadarCategory_Rolls") - o["holdsHit"] = score:GetRadarValues():GetValue("RadarCategory_Holds") + score:GetRadarValues():GetValue("RadarCategory_Rolls") + o["totalHolds"] = pss:GetRadarPossible():GetValue("RadarCategory_Holds") + pss:GetRadarPossible():GetValue("RadarCategory_Rolls") + o["holdsHit"] = gatherRadarValue("RadarCategory_Holds", score) + gatherRadarValue("RadarCategory_Rolls", score) o["holdsMissed"] = o["totalHolds"] - o["holdsHit"] - o["minesHit"] = score:GetRadarPossible():GetValue("RadarCategory_Mines") - score:GetRadarValues():GetValue("RadarCategory_Mines") + o["minesHit"] = pss:GetRadarPossible():GetValue("RadarCategory_Mines") - gatherRadarValue("RadarCategory_Mines", score) o["totalTaps"] = totalTaps return o end