sync wipe animation and wait for all peers to be at voted status before starting level

This commit is contained in:
ohsqueezy 2024-01-10 16:13:44 -08:00
parent 5745783e68
commit c4c8a1e79b
1 changed files with 3 additions and 3 deletions

6
NS.py
View File

@ -952,8 +952,8 @@ class LevelSelect(Animation):
# Check if peers are still deciding
elif not self.level_launched:
# Launch if time is up or the lobby is empty
if all(peer.status != "level select" or peer.address == "localhost" for peer in self.get_game().peers.values()) or \
# Launch if time is up, the lobby is empty, or everyone present has voted
if all(peer.status != "level select" or peer.status == "voted" for peer in self.get_game().peers.values()) or \
self.launch_forced:
seed = self.get_game().peers["localhost"].seed
for peer in self.get_game().peers.values():
@ -966,7 +966,7 @@ class LevelSelect(Animation):
self.get_game().pop_up("", clear=True)
self.level_launched = True
if self.get_game().count_players() > 1:
(preview.hide() for preview in self.previews)
self.get_game().wipe.start(self.launch_selected_index)
# Update displayed wait message
else: