Skip to content

Commit

Permalink
Fix FindHighestStanding
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoRogai committed Sep 3, 2024
1 parent e821c73 commit 5f18a96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RepHub.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ function RepHub:GetStandingsCount(standingsTable)
end

function RepHub:FindHighestStanding(standingsTable)
local highestStanding = 0
local highestStanding = nil
local highestStandingCharacterName = nil
for key, value in pairs(standingsTable) do
if RepHub:GetStandingsCount(standingsTable) == 1 or value > highestStanding then
if highestStanding == nil or value > highestStanding then
highestStanding = value
highestStandingCharacterName = key
end
Expand Down

0 comments on commit 5f18a96

Please sign in to comment.