Skip to content

Commit

Permalink
fix bad timer update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Apr 14, 2024
1 parent 253ad2a commit 45ee75f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions code/game/machinery/doors/brigdoors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
if(!length(doors) && !length(flashers) && length(closets))
obj_break()


//Main door timer loop, if it's timing and time is >0 reduce time by 1.
// if it's less than 0, open door, reset timer
// update the door_timer window and the icon
Expand All @@ -64,7 +63,7 @@

if(REALTIMEOFDAY - activation_time >= timer_duration)
timer_end() // open doors, reset timer, clear status screen
update_icon()
update_content()

/**
* Update the display content.
Expand Down Expand Up @@ -111,10 +110,9 @@
if(closet.opened && !closet.close())
continue
closet.locked = TRUE
closet.update_icon()
closet.update_appearance()
return 1


/**
* Stops the timer and resets the timer to 0, and opens the linked door.
* Arguments:
Expand All @@ -137,7 +135,7 @@
for(var/datum/weakref/door_ref as anything in doors)
var/obj/machinery/door/window/brigdoor/door = door_ref.resolve()
if(!door)
doors -= door_ref
doors -= door_ref
continue
if(!door.density)
continue
Expand All @@ -153,7 +151,7 @@
if(closet.opened)
continue
closet.locked = FALSE
closet.update_icon()
closet.update_appearance()

return 1

Expand Down Expand Up @@ -189,7 +187,7 @@
/obj/machinery/status_display/door_timer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "BrigTimer")
ui = new(user, src, "BrigTimer", name)
ui.open()

/obj/machinery/status_display/door_timer/ui_data()
Expand All @@ -210,7 +208,8 @@
return data

/obj/machinery/status_display/door_timer/ui_act(action, params)
if(..())
. = ..()
if(.)
return
. = TRUE

Expand Down

0 comments on commit 45ee75f

Please sign in to comment.