Skip to content

Commit

Permalink
No smarts allowed
Browse files Browse the repository at this point in the history
Easier to understand.
  • Loading branch information
nanaya committed Jan 15, 2025
1 parent adecc03 commit ac1b77b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/Models/Multiplayer/Room.php
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,7 @@ private function assertValidStartPlay(User $user, PlaylistItem $playlistItem, ar

if ($playlistItem->freestyle) {
// assert the beatmap_id is part of playlist item's beatmapset
$beatmapsetIdCount = Beatmap
::whereKey([$playlistItem->beatmap_id, $params['beatmap_id']])
->distinct('beatmapset_id')
->count();
if ($beatmapsetIdCount !== 1) {
if ($playlistItem->beatmap->beatmapset_id !== Beatmap::find($params['beatmap_id'])?->getKey()) {
throw new InvariantException('Specified beatmap_id is not allowed');
}
}
Expand Down

0 comments on commit ac1b77b

Please sign in to comment.