Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Readability - Door Control #18162

Merged
merged 3 commits into from
Jul 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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