Skip to content

Commit

Permalink
Fix AI rating for sub-1.0 ratings (#6194)
Browse files Browse the repository at this point in the history
  • Loading branch information
maudlin27 committed May 20, 2024
1 parent 4f042bf commit 1a61e26
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lua/ui/lobby/lobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -493,14 +493,7 @@ function ComputeAIRating(gameOptions, aiLobbyProperties)
local cheatBuildMultiplier = (tonumber(gameOptions.BuildMult) or 1.0) - 1.0
local cheatResourceMultiplier = (tonumber(gameOptions.CheatMult) or 1.0) - 1.0

-- if they're smaller than 1.0 then the AI doesn't get better; it gets worse!
if cheatBuildMultiplier < 0 then
cheatBuildMultiplier = 1 / cheatBuildMultiplier
end

if cheatResourceMultiplier < 0 then
cheatResourceMultiplier = 1 / cheatResourceMultiplier
end


-- compute the rating
local cheatBuildValue = (aiLobbyProperties.ratingBuildMultiplier or 0.0) * cheatBuildMultiplier
Expand Down

0 comments on commit 1a61e26

Please sign in to comment.