From a6c6236e4fcdf6d44dbdbf1195a798d2a4cf9d58 Mon Sep 17 00:00:00 2001 From: Lukas Martini Date: Thu, 7 Jul 2016 03:30:43 +0200 Subject: [PATCH] Stop start vote timer if player leaving is the only one who voted --- src/wolfgame.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wolfgame.py b/src/wolfgame.py index 88fe338..b7db27d 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -3062,6 +3062,11 @@ def del_player(cli, nick, forced_death=False, devoice=True, end_game=True, death with var.WARNING_LOCK: var.START_VOTES.discard(nick) + # Cancel the start vote timer if there are no votes left + if len(var.START_VOTES) < 1 and 'start_votes' in var.TIMERS: + var.TIMERS['start_votes'][0].cancel() + del var.TIMERS['start_votes'] + # Died during the joining process as a person if var.AUTO_TOGGLE_MODES and nick in var.USERS and var.USERS[nick]["moded"]: for newmode in var.USERS[nick]["moded"]: