Skip to content

Commit

Permalink
Merge pull request #11190 from nanaya/score-float-part2
Browse files Browse the repository at this point in the history
Fix another float/int mismatch
  • Loading branch information
peppy authored May 2, 2024
2 parents 593cd0f + 49c51d3 commit f73ea11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Models/Traits/Scoreable.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public function recalculateRank(): void
switch ($this->getMode()) {
case 'osu':
$totalHitCount = $totalHits / 300;
$ratio300 = $totalHits === 0 ? 1 : $this->count300 / $totalHitCount;
$ratio50 = $totalHits === 0 ? 1 : $this->count50 / $totalHitCount;
$ratio300 = (float) ($totalHits === 0 ? 1 : $this->count300 / $totalHitCount);
$ratio50 = (float) ($totalHits === 0 ? 1 : $this->count50 / $totalHitCount);

$this->rank = match (true) {
$ratio300 === 1.0 =>
Expand All @@ -109,8 +109,8 @@ public function recalculateRank(): void

case 'taiko':
$totalHitCount = $totalHits / 300;
$ratio300 = $totalHits === 0 ? 1 : $this->count300 / $totalHitCount;
$ratio50 = $totalHits === 0 ? 1 : $this->count50 / $totalHitCount;
$ratio300 = (float) ($totalHits === 0 ? 1 : $this->count300 / $totalHitCount);
$ratio50 = (float) ($totalHits === 0 ? 1 : $this->count50 / $totalHitCount);

$this->rank = match (true) {
$ratio300 === 1.0 =>
Expand Down

0 comments on commit f73ea11

Please sign in to comment.