Merge pull request #654 from 3alTemp/meteor-fix

Meteor Shower minigame end fix
This commit is contained in:
Eric Froemling 2024-03-01 17:41:10 -08:00 committed by GitHub
commit 51a9f39d0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -51,5 +51,8 @@
### Rikko
- Created the original "reject_recently_left_players" plugin
### Temp (3alTemp)
- Modder & Bug Fixer
### brostos
- Added support for joining using ipv6 address

View File

@ -73,6 +73,7 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
self._last_player_death_time: float | None = None
self._meteor_time = 2.0
self._timer: OnScreenTimer | None = None
self._ended: bool = False
# Some base class overrides:
self.default_music = (
@ -161,6 +162,10 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
return None
def _check_end_game(self) -> None:
# We don't want to end this activity more than once.
if self._ended:
return
living_team_count = 0
for team in self.teams:
for player in team.players:
@ -270,4 +275,5 @@ class MeteorShowerGame(bs.TeamGameActivity[Player, Team]):
# Submit the score value in milliseconds.
results.set_team_score(team, int(1000.0 * longest_life))
self._ended = True
self.end(results=results)