Skip to content

Commit

Permalink
Possible fix for reported bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmellor committed Aug 18, 2023
1 parent 6f76ba9 commit bee9aaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Concerns/GiveExperience.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ public function withMultiplierData(array $data): static

public function nextLevelAt(int $checkAgainst = null, bool $showAsPercentage = false): int
{
$nextLevel = Level::firstWhere(column: 'level', operator: '=', value: $checkAgainst ?? $this->getLevel() + 1);
// $nextLevel = Level::firstWhere(column: 'level', operator: '=', value: $checkAgainst ?? $this->getLevel() + 1);
$nextLevel = Level::firstWhere(column: 'level', operator: '=', value: is_null($checkAgainst) ? $this->getLevel() + 1 : $checkAgainst);

if (! $nextLevel || $nextLevel->next_level_experience === null) {
return 0;
Expand Down

0 comments on commit bee9aaa

Please sign in to comment.