From b90ba46e73793977b2f0f75f9c27bb3bcb886ac3 Mon Sep 17 00:00:00 2001 From: nyuszika7h Date: Fri, 21 Feb 2014 10:08:44 +0100 Subject: [PATCH] Fix previous commit (again) --- modules/wolfgame.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 68835a7..3871614 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -2950,13 +2950,13 @@ def _flastgame(cli, nick, chan, rest): @cmd("gamestats", "gstats") def game_stats(cli, nick, chan, rest): """Gets the game stats for a given game size or lists game totals for all game sizes if no game size is given.""" - if (chan and var.LAST_GSTATS and + if (chan != nick and var.LAST_GSTATS and var.LAST_GSTATS + timedelta(seconds=var.GSTATS_RATE_LIMIT) > datetime.now()): cli.notice(nick, ("This command is rate-limited. " + "Please wait a while before using it again.")) return - if chan: + if chan != nick: var.LAST_GSTATS = datetime.now() if var.PHASE not in ("none", "join"): @@ -2984,13 +2984,13 @@ def game_stats_pm(cli, nick, rest): @cmd("playerstats", "pstats", "player", "p") def player_stats(cli, nick, chan, rest): """Gets the stats for the given player and role or a list of role totals if no role is given.""" - if (chan and var.LAST_PSTATS and + if (chan != nick and var.LAST_PSTATS and var.LAST_PSTATS + timedelta(seconds=var.PSTATS_RATE_LIMIT) > datetime.now()): cli.notice(nick, ("This command is rate-limited. " + "Please wait a while before using it again.")) return - if chan: + if chan != nick: var.LAST_PSTATS = datetime.now() if var.PHASE not in ("none", "join"): @@ -3014,7 +3014,7 @@ def player_stats(cli, nick, chan, rest): acc = params[0] # List the player's total games for all roles if no role is given - if len(params) == 1: + if len(params) < 2: cli.msg(chan, var.get_player_totals(acc)) else: role = " ".join(params[1:]).lower()