add var.GRAVEYARD_LOCK check in chk_win, add more checks for game ending in those
This commit is contained in:
parent
6aeb149241
commit
1519ba3765
@ -1318,6 +1318,10 @@ def chk_win(cli, end_game = True):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
with var.GRAVEYARD_LOCK:
|
||||||
|
if var.PHASE not in ("day", "night"):
|
||||||
|
return False #some other thread already ended game probably
|
||||||
|
|
||||||
lwolves = len(var.list_players(var.WOLFCHAT_ROLES))
|
lwolves = len(var.list_players(var.WOLFCHAT_ROLES))
|
||||||
cubs = len(var.ROLES["wolf cub"]) if "wolf cub" in var.ROLES else 0
|
cubs = len(var.ROLES["wolf cub"]) if "wolf cub" in var.ROLES else 0
|
||||||
lrealwolves = len(var.list_players(var.WOLF_ROLES)) - cubs
|
lrealwolves = len(var.list_players(var.WOLF_ROLES)) - cubs
|
||||||
@ -1724,8 +1728,8 @@ def reaper(cli, gameid):
|
|||||||
|
|
||||||
while gameid == var.GAME_ID:
|
while gameid == var.GAME_ID:
|
||||||
with var.GRAVEYARD_LOCK:
|
with var.GRAVEYARD_LOCK:
|
||||||
# Terminate reaper when experiencing disk lag
|
# Terminate reaper when game ends
|
||||||
if var.PHASE == "writing files":
|
if var.PHASE not in ("day", "night"):
|
||||||
return
|
return
|
||||||
if var.WARN_IDLE_TIME or var.PM_WARN_IDLE_TIME or var.KILL_IDLE_TIME: # only if enabled
|
if var.WARN_IDLE_TIME or var.PM_WARN_IDLE_TIME or var.KILL_IDLE_TIME: # only if enabled
|
||||||
to_warn = []
|
to_warn = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user