From ff23246d3db7e38995d59181fa0db33c85424a05 Mon Sep 17 00:00:00 2001 From: AsV9 Date: Mon, 18 Nov 2019 16:19:11 +0100 Subject: [PATCH] Adds support for locking holodeck templates to security levels, and locks medical holodeck behind red or delta seclevel. --- code/game/area/areas/holodeck.dm | 2 ++ code/modules/holodeck/computer.dm | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/area/areas/holodeck.dm b/code/game/area/areas/holodeck.dm index 47a8de404d77..620d815cf9cb 100644 --- a/code/game/area/areas/holodeck.dm +++ b/code/game/area/areas/holodeck.dm @@ -7,6 +7,7 @@ var/obj/machinery/computer/holodeck/linked var/restricted = 0 // if true, program goes on emag list + var/minimum_sec_level = SEC_LEVEL_GREEN //override this var if you want the program to be locked to a different alert-level (eg. SEC_LEVEL_BLUE, SEC_LEVEL_RED, SEC_LEVEL_DELTA) /* Power tracking: Use the holodeck computer's power grid @@ -77,6 +78,7 @@ /area/holodeck/rec_center/medical name = "Holodeck - Emergency Medical" + minimum_sec_level = SEC_LEVEL_RED /area/holodeck/rec_center/pet_lounge name = "Holodeck - Pet Park" diff --git a/code/modules/holodeck/computer.dm b/code/modules/holodeck/computer.dm index a58ddd067bde..590b43f55d79 100644 --- a/code/modules/holodeck/computer.dm +++ b/code/modules/holodeck/computer.dm @@ -231,11 +231,13 @@ var/obj/effect/holodeck_effect/HE = e HE.safety(active) -/obj/machinery/computer/holodeck/proc/load_program(area/A, force = FALSE, add_delay = TRUE) +/obj/machinery/computer/holodeck/proc/load_program(area/holodeck/A, force = FALSE, add_delay = TRUE) if(!is_operational()) A = offline_program force = TRUE - + if(A.minimum_sec_level > GLOB.security_level && !force && !(obj_flags & EMAGGED)) + say("ERROR. Program currently unavailiable, the security level is not high enough.") + return if(program == A) return if(current_cd > world.time && !force)