Skip to content

Commit 33c94ee

Browse files
committed
fix: handle edge case with negative shots missed
1 parent 679f013 commit 33c94ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Models/GamePlayer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public function setOutcomeAttribute(string $value): void
7272
$this->attributes['outcome'] = $outcome->value;
7373
}
7474

75+
public function setShotsMissedAttribute(int $value): void
76+
{
77+
$this->attributes['shots_missed'] = $value < 0 ? 0 : $value;
78+
}
79+
7580
public static function fromHaloDotApi(array $payload): ?self
7681
{
7782
/** @var Player $player */

0 commit comments

Comments
 (0)