Skip to content

Commit

Permalink
fix some rescoring issues with negative radar values in eval
Browse files Browse the repository at this point in the history
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
  • Loading branch information
poco0317 committed Jul 24, 2021
1 parent 9ca8bee commit 750638d
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 750638d

Please sign in to comment.