From 66071c81ba799ecc8eb809de66739b84e825fc42 Mon Sep 17 00:00:00 2001 From: Philip Date: Tue, 27 Aug 2013 16:38:07 -0600 Subject: [PATCH] Update door_control.dm The var desiredstate doesn't update when the airlock closes automatically and so most of the time players have to hit the button twice. This keeps all functionality but with one button press. --- code/game/machinery/door_control.dm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index c4e9fd0230d..63251c2b688 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -80,12 +80,16 @@ if(normaldoorcontrol) for(var/obj/machinery/door/airlock/D in range(range)) if(D.id_tag == src.id) + if(specialfunctions & OPEN) + if (D.density) + spawn(0) + D.open() + return + else + spawn(0) + D.close() + return if(desiredstate == 1) - if(specialfunctions & OPEN) - if (D.density) - spawn( 0 ) - D.open() - return if(specialfunctions & IDSCAN) D.aiDisabledIdScanner = 1 if(specialfunctions & BOLTS) @@ -95,13 +99,7 @@ D.secondsElectrified = -1 if(specialfunctions & SAFE) D.safe = 0 - else - if(specialfunctions & OPEN) - if (!D.density) - spawn( 0 ) - D.close() - return if(specialfunctions & IDSCAN) D.aiDisabledIdScanner = 0 if(specialfunctions & BOLTS) @@ -186,4 +184,4 @@ icon_state = "launcherbtt" active = 0 - return \ No newline at end of file + return