From cd3e15f1517ecb50d8669b62dc42a4fcbca1f9bc Mon Sep 17 00:00:00 2001 From: Profakos Date: Sun, 8 Jan 2023 09:13:58 +0100 Subject: [PATCH] Fixes burn chamber cycling to exterior airlock (#72418) ## About The Pull Request When the ordnance/incinerator burn chamber was cycling to exterior air lock, it got stuck on depressurizing. Turns out, the issues was that during a recent refactor, a command that turned on the dual port pump was missed, so depressurization could never finish. I have fixed this, and also simplified the similar check during repressurization. I hope I fixed it correctly. Furthermore, I have noticed that an old check called by the airlock sensor was still thinking that the defines were numbers, meaning that if you got stuck inside the chamber, and hit it to initiate cycling, it did not work. This has been likewise fixed. Not in the scope of this PR: burn chambers with sanitize_external set to true won't let you abort depressurization. In those chambers, hitting abort while cycling to external airlock means that when depressurization ends, it won't open the external airlocks. This should be communicated better to the player, but this is out of scope of this fix. ## Why It's Good For The Game Fixes #71777 It is good to be able to properly cycle the burn chamber doors, in case you want to edit the pipes. Using the airlock sensor while trapped inside the depressurizing chamber should let you. ## Changelog :cl: fix: burn chambers will not get stuck on depressurizing while cycling to exterior airlocks fix: using an airlock sensor will properly cycle the air inside the chamber /:cl: --- .../machinery/embedded_controller/airlock_controller.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index fff5245955b..ec0dad71860 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -110,10 +110,9 @@ if(pump.pump_direction == ATMOS_DIRECTION_SIPHONING) pump.pressure_checks |= ATMOS_EXTERNAL_BOUND pump.pump_direction = ATMOS_DIRECTION_RELEASING - else if(pump.pump_direction == ATMOS_DIRECTION_RELEASING) + else if(!pump.on) pump.on = TRUE - - pump.update_appearance(UPDATE_ICON) + pump.update_appearance(UPDATE_ICON) else state = AIRLOCK_STATE_CLOSED process_again = TRUE @@ -181,6 +180,8 @@ if(pump.pump_direction == ATMOS_DIRECTION_RELEASING) pump.pressure_checks &= ~ATMOS_EXTERNAL_BOUND pump.pump_direction = ATMOS_DIRECTION_SIPHONING + else if(!pump.on) + pump.on = TRUE pump.update_appearance(UPDATE_ICON) if(AIRLOCK_STATE_OUTOPEN) //state 2 @@ -262,7 +263,7 @@ /// Starts an airlock cycle /obj/machinery/airlock_controller/proc/cycle() - if (state < AIRLOCK_STATE_CLOSED) + if (state == AIRLOCK_STATE_INOPEN || state == AIRLOCK_STATE_PRESSURIZE) target_state = AIRLOCK_STATE_OUTOPEN else target_state = AIRLOCK_STATE_INOPEN