From 528ade4e12f7705707c6a2c8b69ceca96c217f10 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Thu, 15 Sep 2022 08:32:09 -0400 Subject: [PATCH] Fixes emergency pods not working (#69892) * Fixes emergency pods not working * ``get_control_console()`` currently doesn't work because it's runtiming instead of properly finding the shuttle computer, which would cause pod's request() to return and call parent, but parent handles sending the pods off, so I fixed it by not calling parent if they didn't have a console, and also fixed it finding its console. * wtf emagged shuttles can just go? * replaces || with && --- code/modules/shuttle/emergency.dm | 13 ++++++------- code/modules/shuttle/shuttle.dm | 9 +++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 27997ba7c8e..df5e7eaea98 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -579,14 +579,13 @@ /obj/docking_port/mobile/pod/request(obj/docking_port/stationary/S) var/obj/machinery/computer/shuttle/connected_computer = get_control_console() if(!istype(connected_computer, /obj/machinery/computer/shuttle/pod)) - return ..() - if(SSsecurity_level.get_current_level_as_number() >= SEC_LEVEL_RED || (connected_computer && (connected_computer.obj_flags & EMAGGED))) - if(launch_status == UNLAUNCHED) - launch_status = EARLY_LAUNCHED - return ..() - else + return FALSE + if(!(SSsecurity_level.get_current_level_as_number() >= SEC_LEVEL_RED) && !(connected_computer.obj_flags & EMAGGED)) to_chat(usr, span_warning("Escape pods will only launch during \"Code Red\" security alert.")) - return TRUE + return FALSE + if(launch_status == UNLAUNCHED) + launch_status = EARLY_LAUNCHED + return ..() /obj/docking_port/mobile/pod/cancel() return diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index f8415a14913..2d5ac7ae893 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -904,10 +904,11 @@ // attempts to locate /obj/machinery/computer/shuttle with matching ID inside the shuttle /obj/docking_port/mobile/proc/get_control_console() for(var/area/shuttle/shuttle_area as anything in shuttle_areas) - for(var/obj/machinery/computer/shuttle/shuttle_computers as anything in shuttle_area) - if(shuttle_computers.shuttleId != shuttle_id) - continue - return shuttle_computers + var/obj/machinery/computer/shuttle/shuttle_computer = locate(/obj/machinery/computer/shuttle) in shuttle_area + if(!shuttle_computer) + continue + if(shuttle_computer.shuttleId == shuttle_id) + return shuttle_computer return null /obj/docking_port/mobile/proc/hyperspace_sound(phase, list/areas)