From b1e59c4f7781a1a7fd3e6e33ef63bcedf1d810a9 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Thu, 1 Jan 2015 18:59:27 +0000 Subject: [PATCH] !quit: tell player how long until they can quit --- modules/wolfgame.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 4432dd1..f9340fa 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -2731,9 +2731,9 @@ def leave_game(cli, nick, chan, rest): else: population = (" New player count: \u0002{0}\u0002").format(lpl) else: - dur = (datetime.now() - var.GAME_START_TIME).total_seconds() - if var.START_QUIT_DELAY and dur < var.START_QUIT_DELAY: - cli.notice(nick, "The game already started!") + dur = int(var.START_QUIT_DELAY - (datetime.now() - var.GAME_START_TIME).total_seconds()) + if var.START_QUIT_DELAY and dur: + cli.notice(nick, "The game already started! If you still want to quit, try again in {0} second{1}.".format(dur, "" if dur == 1 else "s")) return population = "" if nick not in var.list_players() or nick in var.DISCONNECTED.keys(): # not playing