Skip to content

Commit

Permalink
Code Readability - Door Control (#18162)
Browse files Browse the repository at this point in the history
* door_control

* put comment back

* comment change for autodoc

Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>

Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
  • Loading branch information
KalevTait and hal9000PR authored Jul 1, 2022
1 parent f18bf0f commit 66cad5f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions code/game/machinery/door_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
icon_state = "doorctrl0"
power_channel = ENVIRON
var/id = null
var/safety_z_check = 1
var/normaldoorcontrol = 0
var/desiredstate = 0 // Zero is closed, 1 is open.
var/safety_z_check = TRUE
var/normaldoorcontrol = FALSE
/// FALSE is closed, TRUE is open.
var/desiredstate_open = FALSE
var/specialfunctions = 1
/*
Bitflag, 1= open
Expand All @@ -25,7 +26,7 @@
2=Network Access
*/

anchored = 1.0
anchored = TRUE
use_power = IDLE_POWER_USE
idle_power_usage = 2
active_power_usage = 4
Expand All @@ -43,7 +44,7 @@

/obj/machinery/door_control/emag_act(user as mob)
if(!emagged)
emagged = 1
emagged = TRUE
req_access = list()
req_one_access = list()
playsound(src, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
Expand Down Expand Up @@ -80,7 +81,7 @@
spawn(0)
D.close()
return
if(desiredstate == 1)
if(desiredstate_open)
if(specialfunctions & IDSCAN)
D.aiDisabledIdScanner = 1
if(specialfunctions & BOLTS)
Expand Down Expand Up @@ -113,7 +114,7 @@
M.close()
return

desiredstate = !desiredstate
desiredstate_open = !desiredstate_open
spawn(15)
if(!(stat & NOPOWER))
icon_state = "doorctrl0"
Expand Down

0 comments on commit 66cad5f

Please sign in to comment.