fix players becoming bots

This commit is contained in:
Alberto Xamin 2023-01-21 14:28:34 +00:00
parent 461dfb8841
commit 1b263adc80
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
2 changed files with 2 additions and 2 deletions

View File

@ -678,7 +678,7 @@ class Game:
player.was_player = False player.was_player = False
if len(player.available_characters) > 0: if len(player.available_characters) > 0:
player.set_available_character(player.available_characters) player.set_available_character(player.available_characters)
player.bot_spin() G.sio.start_background_task(player.bot_spin)
else: else:
self.player_death(player=player, disconnected=True) self.player_death(player=player, disconnected=True)
# else: # else:

View File

@ -678,7 +678,7 @@ def chat_message(sid, msg, pl=None):
ses.is_bot = not ses.is_bot ses.is_bot = not ses.is_bot
if (ses.is_bot): if (ses.is_bot):
ses.was_player = True ses.was_player = True
ses.bot_spin() sio.start_background_task(ses.bot_spin)
elif '/arcadekick' in msg and ses.game.started: elif '/arcadekick' in msg and ses.game.started:
if not any((p.pending_action != PendingAction.WAIT for p in ses.game.players)): if not any((p.pending_action != PendingAction.WAIT for p in ses.game.players)):
sio.emit('chat_message', room=ses.game.name, data={'color': f'','text':f'KICKING THE ARCADE CABINET'}) sio.emit('chat_message', room=ses.game.name, data={'color': f'','text':f'KICKING THE ARCADE CABINET'})