Stop the game setup if the preset is unknown
This commit is contained in:
parent
cc6b0af504
commit
b936e3b880
20
gameloop.py
20
gameloop.py
|
@ -434,15 +434,11 @@ def game(send, notice, voice, devoice, get_event):
|
|||
deck_add_handler('PXWKC')
|
||||
deck_add_handler('colondeck')
|
||||
|
||||
elif rest[0] == 'empty':
|
||||
pass
|
||||
|
||||
else:
|
||||
elif rest[0] != 'empty':
|
||||
send('Unknown preset %s' % rest[0])
|
||||
return False
|
||||
|
||||
limit_type = {limit_types.rounds: 'rounds', limit_types.points: 'points'}[limit.type]
|
||||
send('Limit is %i %s, change with !limit' % (limit.number, limit_type))
|
||||
send('Once you are ready to start the game, everyone send !ready')
|
||||
return True
|
||||
|
||||
def no_game():
|
||||
nonlocal players, bots, decks, limit, round_number, round_call_card, czar, card_choices
|
||||
|
@ -472,9 +468,15 @@ def game(send, notice, voice, devoice, get_event):
|
|||
|
||||
send('%s started a game, !join to join!' % nick)
|
||||
|
||||
start_game(rest)
|
||||
if start_game(rest):
|
||||
limit_type = {limit_types.rounds: 'rounds', limit_types.points: 'points'}[limit.type]
|
||||
send('Limit is %i %s, change with !limit' % (limit.number, limit_type))
|
||||
send('Once you are ready to start the game, everyone send !ready')
|
||||
|
||||
return game_setup
|
||||
return game_setup
|
||||
|
||||
else:
|
||||
send('Stopping game')
|
||||
|
||||
elif event == events.join:
|
||||
send('Start a game with !start [<preset>]')
|
||||
|
|
Loading…
Reference in New Issue