Skip to content

Commit

Permalink
use Math.Max
Browse files Browse the repository at this point in the history
  • Loading branch information
cdwcgt committed Nov 17, 2024
1 parent f956aa8 commit c633811
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions osu.Game.Tournament/Screens/Gameplay/GameplayScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,25 +478,13 @@ private void getResult()
{
// 黄金加成
CurrentMatch.Value.Team1Coin.Value += WINNER_BONUS + (isTB ? EXTRA_WINNER_BONUS_TB : 0);
double lossPoint = Math.Round((double)roundInfo.Score2.Value / roundInfo.Score1.Value * 100, 2, MidpointRounding.AwayFromZero);

if (!double.IsNaN(lossPoint))
{
CurrentMatch.Value.Team2Coin.Value += lossPoint;
}

CurrentMatch.Value.Team2Coin.Value += Math.Round((double)roundInfo.Score2.Value / Math.Max(roundInfo.Score1.Value, 1) * 100, 2, MidpointRounding.AwayFromZero);
showDraw(TeamColour.Red);
}
else
{
CurrentMatch.Value.Team2Coin.Value += WINNER_BONUS + (isTB ? EXTRA_WINNER_BONUS_TB : 0);
double lossPoint = Math.Round((double)roundInfo.Score1.Value / roundInfo.Score2.Value * 100, 2, MidpointRounding.AwayFromZero);

if (!double.IsNaN(lossPoint))
{
CurrentMatch.Value.Team1Coin.Value += lossPoint;
}

CurrentMatch.Value.Team1Coin.Value += Math.Round((double)roundInfo.Score1.Value / Math.Max(roundInfo.Score2.Value, 1) * 100, 2, MidpointRounding.AwayFromZero);;
showDraw(TeamColour.Blue);
}

Expand Down

0 comments on commit c633811

Please sign in to comment.