From 2aa4644ad83b3c89f4a49aa459259df7b60d27c0 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Sat, 9 Dec 2017 16:56:46 -0600 Subject: [PATCH] Fix double lynch bug in new mode --- src/gamemodes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gamemodes.py b/src/gamemodes.py index 44fec11..1203a4b 100644 --- a/src/gamemodes.py +++ b/src/gamemodes.py @@ -1429,7 +1429,13 @@ class MudkipMode(GameMode): if avail != voted: return + majority = avail // 2 + 1 maxv = max(evt.data["numvotes"].values()) + if maxv >= majority or force: + # normal vote code will result in someone being lynched + # not bailing out here will result in the person being voted twice + return + # make a copy in case an event mutates it in recursive calls tovote = [p for p, n in evt.data["numvotes"].items() if n == maxv] self.recursion_guard = True