From ba74a18471eb8e54b0558628b0893bc2ca3bce69 Mon Sep 17 00:00:00 2001 From: Letter N <24603524+LetterN@users.noreply.github.com> Date: Sat, 6 Aug 2022 13:17:47 +0800 Subject: [PATCH] Update emergency.dm --- code/modules/shuttle/emergency.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index d4e6f3e050..80440a6ff6 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -538,6 +538,10 @@ density = FALSE clockwork = TRUE //it'd look weird +/obj/machinery/computer/shuttle/pod/Initialize(mapload) + . = ..() + RegisterSignal(SSsecurity_level, COMSIG_SECURITY_LEVEL_CHANGED, .proc/check_lock) + /obj/machinery/computer/shuttle/pod/ComponentInitialize() . = ..() AddElement(/datum/element/update_icon_blocker) @@ -555,6 +559,21 @@ if(possible_destinations == initial(possible_destinations) || override) possible_destinations = "pod_lavaland[idnum]" +/** + * Signal handler for checking if we should lock or unlock escape pods accordingly to a newly set security level + * + * Arguments: + * * source The datum source of the signal + * * new_level The new security level that is in effect + */ +/obj/machinery/computer/shuttle/pod/proc/check_lock(datum/source, new_level) + SIGNAL_HANDLER + + if(obj_flags & EMAGGED) + return + + locked = new_level < SEC_LEVEL_RED + /obj/docking_port/stationary/random name = "escape pod" id = "pod"