fix disconnect on character selection
This commit is contained in:
parent
07f30c36e6
commit
637f05e37f
@ -83,6 +83,8 @@ def get_me(sid, room):
|
||||
de_games[0].notify_all()
|
||||
sio.emit('role', room=sid, data=json.dumps(bot.role, default=lambda o: o.__dict__))
|
||||
bot.notify_self()
|
||||
if len(bot.available_characters) > 0:
|
||||
bot.set_available_character(bot.available_characters)
|
||||
else: #spectate
|
||||
de_games[0].spectators.append(sio.get_session(sid))
|
||||
sio.get_session(sid).game = de_games[0]
|
||||
|
@ -374,7 +374,10 @@ class Game:
|
||||
if self.disconnect_bot and self.started:
|
||||
player.is_bot = True
|
||||
eventlet.sleep(15) # he may reconnect
|
||||
player.bot_spin()
|
||||
if player.is_bot:
|
||||
if len(player.available_characters) > 0:
|
||||
player.set_available_character(player.available_characters)
|
||||
player.bot_spin()
|
||||
else:
|
||||
self.player_death(player=player, disconnected=True)
|
||||
# else:
|
||||
|
Loading…
Reference in New Issue
Block a user