From 268129bd9dba6ea4c0beb9569eba473c048c3bb7 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 23 Feb 2017 23:43:32 -0500 Subject: [PATCH] fix potential recursion error during maelstrom when calling chk_win_conditions, maelstrom uses a rolemap where all players are usually '0', this is casted to a set which makes it think there is only one player --- src/gamemodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gamemodes.py b/src/gamemodes.py index a74e92e..6344bec 100644 --- a/src/gamemodes.py +++ b/src/gamemodes.py @@ -1324,9 +1324,11 @@ class MaelstromMode(GameMode): addroles["blessed villager"] = 1 rolemap = defaultdict(list) + pcount = 0 for r,c in addroles.items(): if c > 0: - rolemap[r] = list(range(c)) + rolemap[r] = list(range(pcount, pcount+c)) + pcount += c if self.chk_win_conditions(cli, rolemap, end_game=False): return self._role_attribution(cli, var, villagers, do_templates)