forked from test/mau_mau_bot
remove old, empty games
This commit is contained in:
parent
8dcd05dbb2
commit
91947abce0
1 changed files with 5 additions and 0 deletions
|
@ -47,6 +47,11 @@ class GameManager(object):
|
||||||
if chat_id not in self.chatid_games:
|
if chat_id not in self.chatid_games:
|
||||||
self.chatid_games[chat_id] = list()
|
self.chatid_games[chat_id] = list()
|
||||||
|
|
||||||
|
# remove old games
|
||||||
|
for game in list(self.chatid_games[chat_id]):
|
||||||
|
if not game.players:
|
||||||
|
self.chatid_games[chat_id].remove(game)
|
||||||
|
|
||||||
self.chatid_games[chat_id].append(game)
|
self.chatid_games[chat_id].append(game)
|
||||||
return game
|
return game
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue