From fc1f1107739c2b86c023bd7872b96f4dfe902bd3 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 19 Aug 2014 21:30:55 -0400 Subject: [PATCH] !stats orders names in join order --- modules/wolfgame.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index d2dfa08..72f51fd 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -588,6 +588,8 @@ def stats(cli, nick, chan, rest): return pl = var.list_players() + if var.PHASE in ("night", "day"): + pl = [x for x in var.ALL_PLAYERS if x in pl] if nick != chan and (nick in pl or var.PHASE == "join"): # only do this rate-limiting stuff if the person is in game @@ -599,7 +601,6 @@ def stats(cli, nick, chan, rest): var.LAST_STATS = datetime.now() - pl.sort(key=lambda x: x.lower()) if len(pl) > 1: msg = '{0}: \u0002{1}\u0002 players: {2}'.format(nick, len(pl), ", ".join(pl)) @@ -651,7 +652,7 @@ def stats(cli, nick, chan, rest): amn_roles = {"amnesiac": 0} for amn in var.ORIGINAL_ROLES["amnesiac"]: - if amn not in var.list_players(): + if amn not in pl: continue amnrole = var.get_role(amn)