diff --git a/app/Models/Traits/Scoreable.php b/app/Models/Traits/Scoreable.php index eb5a82c53f8..1afbb37f41e 100644 --- a/app/Models/Traits/Scoreable.php +++ b/app/Models/Traits/Scoreable.php @@ -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 => @@ -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 =>