diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 36c0d49bc59..239184d81dd 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -483,9 +483,9 @@ SUBSYSTEM_DEF(shuttle) //Make all cargo consoles speak up /datum/controller/subsystem/shuttle/proc/checkHostileEnvironment() - for(var/datum/d in hostile_environments) - if(!istype(d) || QDELETED(d)) - hostile_environments -= d + for(var/datum/hostile_environment_source in hostile_environments) + if(QDELETED(hostile_environment_source)) + hostile_environments -= hostile_environment_source emergency_no_escape = hostile_environments.len if(emergency_no_escape && (emergency.mode == SHUTTLE_IGNITING)) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 913e56effe6..511e117f783 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -69,6 +69,7 @@ GLOBAL_PROTECT(admin_verbs_admin) /client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcom*/ /client/proc/admin_disable_shuttle, /*allows us to disable the emergency shuttle admin-wise so that it cannot be called*/ /client/proc/admin_enable_shuttle, /*undoes the above*/ + /client/proc/admin_hostile_environment, /*Allows admins to prevent the emergency shuttle from leaving, also lets admins clear hostile environments if theres one stuck*/ /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ /client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/ diff --git a/code/modules/admin/verbs/adminevents.dm b/code/modules/admin/verbs/adminevents.dm index ff8b7a7df43..3c1c8a67a7b 100644 --- a/code/modules/admin/verbs/adminevents.dm +++ b/code/modules/admin/verbs/adminevents.dm @@ -241,6 +241,31 @@ SSshuttle.emergency.setTimer(SSshuttle.last_call_time) priority_announce("Warning: Emergency Shuttle uplink reestablished, shuttle enabled.", "Emergency Shuttle Uplink Alert", 'sound/misc/announce_dig.ogg') +/client/proc/admin_hostile_environment() + set category = "Admin.Events" + set name = "Hostile Environment" + + if(!check_rights(R_ADMIN)) + return + + switch(tgui_alert(usr, "Select an Option", "Hostile Environment Manager", list("Enable", "Disable", "Clear All"))) + if("Enable") + if (SSshuttle.hostile_environments["Admin"] == TRUE) + to_chat(usr, span_warning("Error, admin hostile environment already enabled.")) + else + message_admins(span_adminnotice("[key_name_admin(usr)] Enabled an admin hostile environment")) + SSshuttle.registerHostileEnvironment("Admin") + if("Disable") + if (!SSshuttle.hostile_environments["Admin"]) + to_chat(usr, span_warning("Error, no admin hostile environment found.")) + else + message_admins(span_adminnotice("[key_name_admin(usr)] Disabled the admin hostile environment")) + SSshuttle.clearHostileEnvironment("Admin") + if("Clear All") + message_admins(span_adminnotice("[key_name_admin(usr)] Disabled all current hostile environment sources")) + SSshuttle.hostile_environments.Cut() + SSshuttle.checkHostileEnvironment() + /client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in GLOB.nuke_list) set category = "Admin.Events" set name = "Toggle Nuke"