From f96d73a8af0805fbb6296285427003e2c701b505 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Thu, 11 Aug 2016 22:36:37 -0500 Subject: [PATCH] Make commands that only work while playing fail silently if the person isn't playing --- messages/en.json | 1 - src/decorators.py | 4 ---- src/wolfgame.py | 5 ----- 3 files changed, 10 deletions(-) diff --git a/messages/en.json b/messages/en.json index aed0a07..d8d04c7 100644 --- a/messages/en.json +++ b/messages/en.json @@ -306,7 +306,6 @@ "ill_wolves": "You are feeling ill tonight, and are unable to kill anyone.", "angry_wolves": "You are \u0002angry\u0002 tonight, and may kill two targets by using \"kill and \".", "wolf_bite": "You may use \"bite \" tonight in order to turn that person into a wolf.", - "player_not_playing": "You're not currently playing.", "werecrow_transformed": "You have already transformed into a crow, and cannot turn back until day.", "retracted_kill": "You have retracted your kill.", "wolfchat_retracted_kill": "\u0002{0}\u0002 has retracted their kill.", diff --git a/src/decorators.py b/src/decorators.py index 0fa0823..3be5191 100644 --- a/src/decorators.py +++ b/src/decorators.py @@ -143,10 +143,6 @@ class cmd: return if self.playing and (nick not in list_players() or nick in var.DISCONNECTED): - if chan == nick: - pm(cli, nick, messages["player_not_playing"]) - else: - cli.notice(nick, messages["player_not_playing"]) return if self.roles: diff --git a/src/wolfgame.py b/src/wolfgame.py index 7643749..82fcd7d 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -5135,7 +5135,6 @@ def retract(cli, nick, chan, rest): if chan not in (botconfig.CHANNEL, nick): return if (nick not in var.VENGEFUL_GHOSTS.keys() and nick not in list_players()) or nick in var.DISCONNECTED.keys(): - cli.notice(nick, messages["player_not_playing"]) return with var.GRAVEYARD_LOCK, var.WARNING_LOCK: @@ -5287,7 +5286,6 @@ def is_safe(nick, victim): # helper function def kill(cli, nick, chan, rest): """Kill a player. Behaviour varies depending on your role.""" if (nick not in var.VENGEFUL_GHOSTS.keys() and nick not in list_players()) or nick in var.DISCONNECTED.keys(): - reply(cli, nick, chan, messages["player_not_playing"], private=True) return try: role = get_role(nick) @@ -6933,7 +6931,6 @@ def start(cli, nick, chan, forced = False, restart = ""): cli.notice(nick, messages["werewolf_already_running"]) return if nick not in villagers and nick != chan and not forced: - cli.notice(nick, messages["player_not_playing"]) return now = datetime.now() @@ -7863,7 +7860,6 @@ def myrole(cli, nick, chan, rest): ps = list_players() if nick not in ps: - cli.notice(nick, messages["player_not_playing"]) return role = get_role(nick) @@ -8423,7 +8419,6 @@ if botconfig.DEBUG_MODE or botconfig.ALLOWED_NORMAL_MODE_COMMANDS: pl = list_players() if nick not in pl and not is_admin(nick): - cli.notice(nick, messages["player_not_playing"]) return if rest: