forked from test/mau_mau_bot
remove player even if its not registered in player list of user
This commit is contained in:
parent
91947abce0
commit
fe98147377
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue