From fe9814737770a8e864f85cf79b5c5c8953b7a52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Fri, 3 Jun 2016 07:58:05 +0200 Subject: [PATCH] remove player even if its not registered in player list of user --- game_manager.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/game_manager.py b/game_manager.py index 75620b0..e1a2fc0 100644 --- a/game_manager.py +++ b/game_manager.py @@ -102,7 +102,17 @@ class GameManager(object): players = self.userid_players.get(user.id, list()) if not player: - raise NoGameInChatError + games = self.chatid_games[chat.id] + for g in games: + for p in g: + if p.user.id == user.id: + if p is g.current_player: + g.turn() + + p.leave() + return + else: + raise NoGameInChatError game = player.game