Fix a bug if we lose all players during setup
This commit is contained in:
parent
e61e45794c
commit
ed6861a7f4
1 changed files with 5 additions and 4 deletions
|
@ -213,7 +213,8 @@ def game(send, notice, get_event):
|
||||||
|
|
||||||
elif event == events.nick_change:
|
elif event == events.nick_change:
|
||||||
old, new = args
|
old, new = args
|
||||||
change_player_nick(old, new)
|
if old in players:
|
||||||
|
change_player_nick(old, new)
|
||||||
|
|
||||||
elif event == events.join:
|
elif event == events.join:
|
||||||
nick, = args
|
nick, = args
|
||||||
|
@ -318,13 +319,13 @@ def game(send, notice, get_event):
|
||||||
players_ready = set()
|
players_ready = set()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
players_unready = [i for i in players.values() if i not in players_ready]
|
|
||||||
if len(players_unready) == 0: break
|
|
||||||
|
|
||||||
if len(players) == 0:
|
if len(players) == 0:
|
||||||
send('Lost all players, quiting game setup')
|
send('Lost all players, quiting game setup')
|
||||||
return no_game
|
return no_game
|
||||||
|
|
||||||
|
players_unready = [i for i in players.values() if i not in players_ready]
|
||||||
|
if len(players_unready) == 0: break
|
||||||
|
|
||||||
event, *args = get_event()
|
event, *args = get_event()
|
||||||
|
|
||||||
if event == events.status:
|
if event == events.status:
|
||||||
|
|
Loading…
Reference in a new issue