From ed62cbbfc9abc13ff9c65effde325e564b52bd75 Mon Sep 17 00:00:00 2001 From: Robert Wall Date: Mon, 15 Jul 2013 19:37:10 -0700 Subject: [PATCH] Change branch condition for checking if night is over, fixes #17 chk_nightdone used to check whether the number of people seen equals the number of seers (and the same for harlot, etc.). This means night times out if the seer (etc.) leaves after seeing but before night is otherwise ended. This commit changes equals to >=, and swaps around the wolf part of that condition so that it matches the other parts. --- modules/wolfgame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index d202c6a..4856ceb 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -1457,10 +1457,10 @@ def transition_day(cli, gameid=0): def chk_nightdone(cli): - if (len(var.SEEN) == len(var.ROLES["seer"]) and # Seers have seen. - len(var.HVISITED.keys()) == len(var.ROLES["harlot"]) and # harlots have visited. - len(var.GUARDED.keys()) == len(var.ROLES["guardian angel"]) and # guardians have guarded - len(var.ROLES["werecrow"]+var.ROLES["wolf"]) == len(var.KILLS)+len(var.OBSERVED) and + if (len(var.SEEN) >= len(var.ROLES["seer"]) and # Seers have seen. + len(var.HVISITED.keys()) >= len(var.ROLES["harlot"]) and # harlots have visited. + len(var.GUARDED.keys()) >= len(var.ROLES["guardian angel"]) and # guardians have guarded + len(var.KILLS)+len(var.OBSERVED) >= len(var.ROLES["werecrow"]+var.ROLES["wolf"]) and var.PHASE == "night"): # check if wolves are actually agreeing