From 028c5c9ae2ef8abffc5f9b4d168a0b5bdbb98658 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Fri, 4 Sep 2015 18:39:41 -0400 Subject: [PATCH] fix crash in games with traitor / wolf cub --- src/wolfgame.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wolfgame.py b/src/wolfgame.py index 7c973a7..2794467 100644 --- a/src/wolfgame.py +++ b/src/wolfgame.py @@ -2546,6 +2546,11 @@ def chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, l winner = "wolves" elif lrealwolves == 0: chk_traitor(cli) + # update variables for recursive call (this shouldn't happen when checking 'random' role attribution, where it would probably fail) + lwolves = len(var.list_players(var.WOLFCHAT_ROLES)) + lcubs = len(var.ROLES.get("wolf cub", ())) + lrealwolves = len(var.list_players(var.WOLF_ROLES - {"wolf cub"})) + ltraitors = len(var.ROLES.get("traitor", ())) return chk_win_conditions(lpl, lwolves, lcubs, lrealwolves, lmonsters, ltraitors, lpipers, cli, end_game) event = Event("chk_win", {"winner": winner, "message": message})