From 53eaf0c2bb7bd01219546fc8e874afadf90cc05d Mon Sep 17 00:00:00 2001 From: jimmyl <70376633+mc-oofert@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:48:59 +0200 Subject: [PATCH] fixes brig timer ui (#84429) ## About The Pull Request fixes #84424, a bug caused by #83520 ## Changelog :cl: fix: brig cell timer ui works properly now /:cl: Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com> --- code/game/machinery/doors/brigdoors.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 34a161acac1..26dc09204a7 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -173,21 +173,21 @@ * * seconds - Return the time in seconds if TRUE, else deciseconds. */ /obj/machinery/status_display/door_timer/proc/time_left(seconds = FALSE) - . = max(0, timer_duration + activation_time - world.time) + . = max(0, timer_duration + (activation_time ? activation_time - world.time : 0)) if(seconds) . /= (1 SECONDS) /** * Set the timer. Does NOT automatically start counting down, but does update the display. * - * returns TRUE if no change occurred + * returns FALSE if no change occurred * * Arguments: * value - time in deciseconds to set the timer for. */ /obj/machinery/status_display/door_timer/proc/set_timer(value) - var/new_time = clamp(value, 0, MAX_TIMER + world.time - activation_time) - . = new_time == timer_duration //return 1 on no change + var/new_time = clamp(value, 0, MAX_TIMER) + . = new_time != timer_duration //return 1 on change timer_duration = new_time update_content()