From e0f2ea166c632968b546bfa1f03b289e3b1ec434 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Thu, 28 Jul 2011 18:50:20 -0500 Subject: [PATCH] now unmarking !away saves --- wolfgame.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wolfgame.py b/wolfgame.py index 0fcf1d7..64dfc70 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -287,6 +287,7 @@ def away(cli, nick, *rest): if cloak in var.AWAY: var.AWAY.remove(cloak) cli.notice(nick, "You are now no longer marked as away.") + var.save_data() return var.AWAY.append(cloak) var.save_data() @@ -1845,7 +1846,7 @@ def fwait(cli, nick, chan, rest): cli.notice(nick, "Werewolf is already in play.") return - rest = rest.strip() + rest = re.split(" +", rest.strip(), 1)[0] if rest and rest.isdigit(): if len(rest) < 4: extra = int(rest) @@ -2084,8 +2085,12 @@ if botconfig.DEBUG_MODE: pl = var.list_players() if var.PHASE not in ("night", "day"): cli.msg(chan, "This is only allowed in game.") - if rol == "gunner": - var.GUNNERS[who] = var.MAX_SHOTS + if rol.startswith("gunner"): + rolargs = re.split(" +",rol, 1) + if len(rolargs) == 2 and len(rolargs[1]) < 7 and rolargs[1].isdigit(): + var.GUNNERS[who] = int(rolargs[1]) + else: + var.GUNNERS[who] = var.MAX_SHOTS if who not in pl: var.ROLES["villager"].append(who) elif rol == "cursed":