Fix timers failing if time lord dies on beginning of day
This commit is contained in:
parent
05d5c39eb5
commit
aefd9cf5ab
@ -2385,8 +2385,9 @@ def del_player(cli, nick, forced_death = False, devoice = True, end_game = True,
|
|||||||
"day will now only last {0} seconds and night will now only " +
|
"day will now only last {0} seconds and night will now only " +
|
||||||
"last {1} seconds!").format(var.TIME_LORD_DAY_LIMIT, var.TIME_LORD_NIGHT_LIMIT))
|
"last {1} seconds!").format(var.TIME_LORD_DAY_LIMIT, var.TIME_LORD_NIGHT_LIMIT))
|
||||||
if var.PHASE == "day" and not botconfig.DEBUG_MODE:
|
if var.PHASE == "day" and not botconfig.DEBUG_MODE:
|
||||||
var.TIMERS["day"][0].cancel()
|
if "day" in var.TIMERS:
|
||||||
if var.TIMERS["day_warn"][0].isAlive():
|
var.TIMERS["day"][0].cancel()
|
||||||
|
if "day_warn" in var.TIMERS and var.TIMERS["day_warn"][0].isAlive():
|
||||||
var.TIMERS["day_warn"][0].cancel()
|
var.TIMERS["day_warn"][0].cancel()
|
||||||
t = threading.Timer(var.TIME_LORD_DAY_LIMIT, hurry_up, [cli, var.DAY_ID, True])
|
t = threading.Timer(var.TIME_LORD_DAY_LIMIT, hurry_up, [cli, var.DAY_ID, True])
|
||||||
var.TIMERS["day"] = (t, time.time(), var.TIME_LORD_DAY_LIMIT)
|
var.TIMERS["day"] = (t, time.time(), var.TIME_LORD_DAY_LIMIT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user