Cycling Airlocks Tweak

When cycling into a direction the airlock has already reached the target
pressure for, doing so will only toggle the doors.
This commit is contained in:
Hubblenaut
2018-02-07 17:31:56 -05:00
committed by Leshana
parent 442b5cbdf6
commit 9db9681663
2 changed files with 44 additions and 3 deletions
@@ -109,13 +109,18 @@
var/shutdown_pump = 0
switch(command)
if("cycle_ext")
//If airlock is already cycled in this direction, just toggle the doors.
if(!memory["purge"] && IsInRange(memory["external_sensor_pressure"], memory["chamber_sensor_pressure"] * 0.95, memory["chamber_sensor_pressure"] * 1.05))
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "toggle")
//only respond to these commands if the airlock isn't already doing something
//prevents the controller from getting confused and doing strange things
if(state == target_state)
else if(state == target_state)
begin_cycle_out()
if("cycle_int")
if(state == target_state)
if(!memory["purge"] && IsInRange(memory["internal_sensor_pressure"], memory["chamber_sensor_pressure"] * 0.95, memory["chamber_sensor_pressure"] * 1.05))
toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "toggle")
else if(state == target_state)
begin_cycle_in()
if("cycle_ext_door")
@@ -216,7 +221,7 @@
memory["target_pressure"] = memory["internal_sensor_pressure"]
state = STATE_PREPARE
target_state = TARGET_NONE
else if(memory["pump_status"] != "off")
signalPump(tag_airpump, 0)
else
+36
View File
@@ -0,0 +1,36 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
#################################
# Your name.
author: Hubblenaut
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "If a cycling airlock is already near the target pressure, pressing the buttons will toggle the doors instead of making it reenter the cycle process."