From 7ba8290ecefc86963edd503dd824edccb2bee10a Mon Sep 17 00:00:00 2001 From: skizzerz Date: Fri, 22 Dec 2017 12:49:55 -0600 Subject: [PATCH] Mael and mudkip bugfixes In mael, when giving wolflist to someone who joined midday, I assumed that pl was a player list when it was already finessed into a list of strings. In mudkip, it is possible for the lynch logic to try to lynch someone twice due to how chk_decision works (if you're forcing someone and someone ELSE has a majority vote, who actually gets voted depends on the order in which the dict keys are iterated over). As a result, ensure that the only possible choice to lynch is the person we're interested in lynching. --- src/gamemodes.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gamemodes.py b/src/gamemodes.py index d66c2a3..1a51cb9 100644 --- a/src/gamemodes.py +++ b/src/gamemodes.py @@ -1269,7 +1269,7 @@ class MaelstromMode(GameMode): pl[i] = "\u0002{0}\u0002 ({1}{2})".format(player, cursed, prole) elif player in var.ROLES["cursed villager"]: pl[i] = player.nick + " (cursed)" - wrapper.pm("Players: " + ", ".join(p.nick for p in pl)) + wrapper.pm("Players: " + ", ".join(pl)) def role_attribution(self, evt, cli, var, chk_win_conditions, villagers): self.chk_win_conditions = chk_win_conditions @@ -1424,8 +1424,11 @@ class MudkipMode(GameMode): # of a stalemate, as they could use the extra help (especially in 5p). if self.recursion_guard: # in here, this means we're in a child chk_decision event called from this one - # the only thing we need to do is ensure we don't turn into nighttime prematurely + # we need to ensure we don't turn into nighttime prematurely or try to vote + # anyone other than the person we're forcing the lynch on evt.data["transition_night"] = lambda cli: None + evt.data["votelist"] = {force: set()} + evt.data["numvotes"] = {force: 0} return avail = len(evt.params.voters) @@ -1454,6 +1457,10 @@ class MudkipMode(GameMode): if var.GAME_ID == gameid: evt.data["transition_night"](cli) + # make original chk_decision that called us no-op + evt.data["votelist"] = {} + evt.data["numvotes"] = {} + def daylight_warning(self, evt, var): evt.data["message"] = "daylight_warning_killtie"