diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 5e6c67c9415..b0be899942d 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -31,15 +31,15 @@ maptext_height = 26 maptext_width = 32 -/obj/machinery/door_timer/New() +/obj/machinery/door_timer/initialize() ..() Radio = new /obj/item/device/radio(src) Radio.listening = 0 Radio.config(list("Security" = 0)) - pixel_x = ((src.dir & 3)? (0) : (src.dir == 4 ? 32 : -32)) - pixel_y = ((src.dir & 3)? (src.dir ==1 ? 24 : -32) : (0)) + pixel_x = ((dir & 3)? (0) : (dir == 4 ? 32 : -32)) + pixel_y = ((dir & 3)? (dir ==1 ? 24 : -32) : (0)) spawn(20) for(var/obj/machinery/door/window/brigdoor/M in airlocks) @@ -53,7 +53,7 @@ for(var/obj/structure/closet/secure_closet/brig/C in world) if(C.id == id) targets += C - + for(var/obj/machinery/treadmill_monitor/T in machines) if(T.id == id) targets += T @@ -61,15 +61,14 @@ if(targets.len==0) stat |= BROKEN update_icon() - return - return //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 /obj/machinery/door_timer/process() - if(stat & (NOPOWER|BROKEN)) return + if(stat & (NOPOWER|BROKEN)) + return if(timing) if(timeleft() <= 0) Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z)) @@ -77,8 +76,8 @@ timing = 0 . = PROCESS_KILL - src.updateUsrDialog() - src.update_icon() + updateUsrDialog() + update_icon() else timer_end() return PROCESS_KILL @@ -87,7 +86,6 @@ /obj/machinery/door_timer/power_change() ..() update_icon() - return // open/closedoor checks if door_timer has power, if so it checks if the @@ -95,7 +93,8 @@ // Closes and locks doors, power check /obj/machinery/door_timer/proc/timer_start() - if(stat & (NOPOWER|BROKEN)) return 0 + if(stat & (NOPOWER|BROKEN)) + return 0 // Set releasetime releasetime = world.timeofday + timetoset @@ -103,16 +102,19 @@ addAtProcessing() for(var/obj/machinery/door/window/brigdoor/door in targets) - if(door.density) continue + if(door.density) + continue spawn(0) door.close() for(var/obj/structure/closet/secure_closet/brig/C in targets) - if(C.broken) continue - if(C.opened && !C.close()) continue + if(C.broken) + continue + if(C.opened && !C.close()) + continue C.locked = 1 C.icon_state = C.icon_locked - + for(var/obj/machinery/treadmill_monitor/T in targets) T.total_joules = 0 T.on = 1 @@ -122,19 +124,23 @@ // Opens and unlocks doors, power check /obj/machinery/door_timer/proc/timer_end() - if(stat & (NOPOWER|BROKEN)) return 0 + if(stat & (NOPOWER|BROKEN)) + return 0 // Reset releasetime releasetime = 0 for(var/obj/machinery/door/window/brigdoor/door in targets) - if(!door.density) continue + if(!door.density) + continue spawn(0) door.open() for(var/obj/structure/closet/secure_closet/brig/C in targets) - if(C.broken) continue - if(C.opened) continue + if(C.broken) + continue + if(C.opened) + continue C.locked = 0 C.icon_state = C.icon_closed @@ -156,7 +162,7 @@ return time / 10 // Set timetoset -/obj/machinery/door_timer/proc/timeset(var/seconds) +/obj/machinery/door_timer/proc/timeset(seconds) timetoset = seconds * 10 if(timetoset <= 0) @@ -165,15 +171,15 @@ return //Allows AIs to use door_timer, see human attack_hand function below -/obj/machinery/door_timer/attack_ai(var/mob/user as mob) - return src.attack_hand(user) +/obj/machinery/door_timer/attack_ai(mob/user) + return attack_hand(user) //Allows humans to use door_timer //Opens dialog window when someone clicks on door timer // Allows altering timer and the timing boolean. // Flasher activation limited to 150 seconds -/obj/machinery/door_timer/attack_hand(var/mob/user as mob) +/obj/machinery/door_timer/attack_hand(mob/user) if(..()) return @@ -189,10 +195,10 @@ // dat var/dat = "