Skip to content

Commit

Permalink
Fix calculated actual EX counts for mines when NoMines is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
teejusb committed Mar 26, 2022
1 parent 2587f68 commit 3bc4f32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@ for index, RCType in ipairs(RadarCategories.Types) do
local possible = counts["total"..RCType]
local performance = counts[RCType]

local po = GAMESTATE:GetPlayerState(player):GetPlayerOptions("ModsLevel_Preferred")
if po:NoMines() then
-- No mines, performance should be 0.
-- "possible" would be 0 in counts so we don't want the subtraction below to result in
-- a negative number.
performance = 0
else
-- Mines should be displayed as mines dodged, while counts show mines hit.
performance = (possible - counts[RCType])
end

possible = clamp(possible, 0, 999)

-- player performance value
Expand Down
10 changes: 5 additions & 5 deletions Scripts/SL-Helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -681,16 +681,16 @@ GetExJudgmentCounts = function(player)
local number = stats:GetRadarActual():GetValue( "RadarCategory_"..RCType )
local possible = StepsOrTrail:GetRadarValues(player):GetValue( "RadarCategory_"..RCType )

-- We want to keep track of mines hit.
if RCType == "Mines" then
counts[RCType] = possible - number

-- Nomines still report the total number of mines that exist in a chart, even if they weren't played in the chart.
-- If nomines was set, report 0 for the number of mines as the chart actually didn't have any.
-- NoMines still report the total number of mines that exist in a chart, even if they weren't played in the chart.
-- If NoMines was set, report 0 for the number of mines as the chart actually didn't have any.
-- TODO(teejusb): Track AvoidMine in the future. This is fine for now as ITL compares serverside.
if po:NoMines() then
counts[RCType] = 0
counts["total"..RCType] = 0
else
-- We want to keep track of mines hit.
counts[RCType] = possible - number
counts["total"..RCType] = possible
end
else
Expand Down

0 comments on commit 3bc4f32

Please sign in to comment.