mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
i hath done an oopsie
This commit is contained in:
parent
527d9fcd4f
commit
3ef572f3d8
1 changed files with 4 additions and 3 deletions
|
|
@ -67,11 +67,11 @@ class RandomPlaylist:
|
||||||
all_games: list[ba.GameActivity]
|
all_games: list[ba.GameActivity]
|
||||||
usable_games: list[ba.GameActivity]
|
usable_games: list[ba.GameActivity]
|
||||||
|
|
||||||
last_game: ba.GameActivity
|
last_game: str
|
||||||
|
|
||||||
def __init__(self, sessiontype):
|
def __init__(self, sessiontype):
|
||||||
self.sessiontype = sessiontype
|
self.sessiontype = sessiontype
|
||||||
self.usable_games = [
|
self.usable_games: list[ba.GameActivity] = [
|
||||||
gt
|
gt
|
||||||
for gt in RandomPlaylist.all_games
|
for gt in RandomPlaylist.all_games
|
||||||
if gt.supports_session_type(self.sessiontype)
|
if gt.supports_session_type(self.sessiontype)
|
||||||
|
|
@ -87,7 +87,7 @@ class RandomPlaylist:
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
game = choice(self.usable_games)
|
game = choice(self.usable_games)
|
||||||
if game == self.last_game:
|
if game.name == self.last_game:
|
||||||
# Don't repeat the same game twice
|
# Don't repeat the same game twice
|
||||||
if has_only_one_game:
|
if has_only_one_game:
|
||||||
# ...but don't freeze the game when there's only one game
|
# ...but don't freeze the game when there's only one game
|
||||||
|
|
@ -95,6 +95,7 @@ class RandomPlaylist:
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
self.last_game = game.name
|
||||||
game_map = choice(game.get_supported_maps(self.sessiontype))
|
game_map = choice(game.get_supported_maps(self.sessiontype))
|
||||||
settings = {
|
settings = {
|
||||||
s.name: s.default for s in game.get_available_settings(self.sessiontype)
|
s.name: s.default for s in game.get_available_settings(self.sessiontype)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue