kind-of bugfix for duplicate players

This commit is contained in:
Jannes Höke 2016-06-02 15:36:40 +02:00
parent 5c87e74ae2
commit 8dcd05dbb2

View file

@ -144,10 +144,20 @@ class GameManager(object):
pass pass
if this_users_players: if this_users_players:
try:
self.userid_current[player_in_game.user.id] = this_users_players[0] self.userid_current[player_in_game.user.id] = this_users_players[0]
except KeyError:
pass
else: else:
try:
del self.userid_players[player_in_game.user.id] del self.userid_players[player_in_game.user.id]
except KeyError:
pass
try:
del self.userid_current[player_in_game.user.id] del self.userid_current[player_in_game.user.id]
except KeyError:
pass
self.chatid_games[chat.id].remove(game) self.chatid_games[chat.id].remove(game)
if not self.chatid_games[chat.id]: if not self.chatid_games[chat.id]: