[MIRROR] fixes brig timer ui (#28521)

* fixes brig timer ui

* Update brigdoors.dm

---------

Co-authored-by: jimmyl <70376633+mc-oofert@users.noreply.github.com>
Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-07-01 19:35:50 +05:30
committed by GitHub
co-authored by jimmyl SpaceLoveSs13
parent 8486197304
commit 3a780a4c8c
+4 -4
View File
@@ -177,21 +177,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 - REALTIMEOFDAY) // SKYRAT EDIT CHANGE: original was world.time
. = max(0, timer_duration + (activation_time ? activation_time - REALTIMEOFDAY : 0)) // SKYRAT EDIT CHANGE, Original: . = 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()