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