From 8dc53fc65ebf89bfa8a813d0b2b38282906b53dc Mon Sep 17 00:00:00 2001 From: KalevTait <107985691+KalevTait@users.noreply.github.com> Date: Sat, 2 Jul 2022 17:34:38 +0100 Subject: [PATCH] Code Readability - Doors (#18149) * doors * return TRUE Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> * return TRUE Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> * return TRUE Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> --- code/game/machinery/doors/airlock.dm | 16 +++--- code/game/machinery/doors/airlock_control.dm | 8 +-- code/game/machinery/doors/airlock_types.dm | 56 ++++++++++---------- code/game/machinery/doors/alarmlock.dm | 10 ++-- code/game/machinery/doors/brigdoors.dm | 20 +++---- code/game/machinery/doors/door.dm | 12 ++--- code/game/machinery/doors/firedoor.dm | 4 +- code/game/machinery/doors/poddoor.dm | 2 +- code/game/machinery/doors/shutters.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 12 ++--- 10 files changed, 71 insertions(+), 71 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index c4baf16ad436..57c8ad5f1fb0 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -49,7 +49,7 @@ GLOBAL_LIST_EMPTY(airlock_overlays) name = "airlock" icon = 'icons/obj/doors/airlocks/station/public.dmi' icon_state = "closed" - anchored = 1 + anchored = TRUE max_integrity = 300 integrity_failure = 70 damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_N @@ -74,11 +74,11 @@ GLOBAL_LIST_EMPTY(airlock_overlays) var/lights = TRUE // bolt lights show by default var/datum/wires/airlock/wires var/aiDisabledIdScanner = FALSE - var/aiHacking = 0 + var/aiHacking = FALSE var/obj/machinery/door/airlock/closeOther var/closeOtherId var/lockdownbyai = 0 - var/justzap = 0 + var/justzap = FALSE var/obj/item/airlock_electronics/electronics var/shockCooldown = FALSE //Prevents multiple shocks from happening var/obj/item/note //Any papers pinned to the airlock @@ -191,9 +191,9 @@ GLOBAL_LIST_EMPTY(airlock_overlays) if(isElectrified()) if(!justzap) if(shock(user, 100)) - justzap = 1 + justzap = TRUE spawn (10) - justzap = 0 + justzap = FALSE return else return @@ -617,7 +617,7 @@ GLOBAL_LIST_EMPTY(airlock_overlays) return else if(!canAIHack(user)) to_chat(user, "Connection lost! Unable to hack airlock.") - aiHacking=0 + aiHacking = FALSE return to_chat(user, "Fault confirmed: airlock control wire disabled or cut.") sleep(20) @@ -1215,7 +1215,7 @@ GLOBAL_LIST_EMPTY(airlock_overlays) if(operating && !forced) return 0 - locked = 1 + locked = TRUE playsound(src, boltDown, 30, 0, 3) update_icon() return 1 @@ -1228,7 +1228,7 @@ GLOBAL_LIST_EMPTY(airlock_overlays) if(operating || !arePowerSystemsOn() || wires.is_cut(WIRE_DOOR_BOLTS)) return - locked = 0 + locked = FALSE playsound(src,boltUp, 30, 0, 3) update_icon() return 1 diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index f7427d3c9fdb..6df716b46647 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -142,7 +142,7 @@ icon_state = "airlock_sensor_off" layer = ABOVE_WINDOW_LAYER name = "airlock sensor" - anchored = 1 + anchored = TRUE resistance_flags = FIRE_PROOF power_channel = ENVIRON @@ -151,7 +151,7 @@ frequency = 1379 var/command = "cycle" - var/on = 1 + var/on = TRUE var/alert = 0 var/previousPressure @@ -219,12 +219,12 @@ icon_state = "access_button_standby" name = "access button" layer = ABOVE_WINDOW_LAYER - anchored = 1 + anchored = TRUE power_channel = ENVIRON var/master_tag frequency = AIRLOCK_FREQ var/command = "cycle" - var/on = 1 + var/on = TRUE /obj/machinery/access_button/update_icon() if(on) diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 869a8049e67d..d0a2d17d897a 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -64,53 +64,53 @@ */ /obj/machinery/door/airlock/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/command/glass - opacity = 0 + opacity = FALSE glass = TRUE normal_integrity = 400 /obj/machinery/door/airlock/engineering/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/security/glass - opacity = 0 + opacity = FALSE glass = TRUE normal_integrity = 400 /obj/machinery/door/airlock/medical/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/virology/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/research/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/mining/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/atmos/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/science/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/maintenance/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/maintenance/external/glass - opacity = 0 + opacity = FALSE glass = TRUE normal_integrity = 200 @@ -126,7 +126,7 @@ paintable = FALSE /obj/machinery/door/airlock/gold/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/silver @@ -136,7 +136,7 @@ paintable = FALSE /obj/machinery/door/airlock/silver/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/diamond @@ -149,7 +149,7 @@ /obj/machinery/door/airlock/diamond/glass normal_integrity = 950 - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/uranium @@ -172,7 +172,7 @@ /obj/machinery/door/airlock/uranium/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/plasma @@ -216,7 +216,7 @@ return 0 /obj/machinery/door/airlock/plasma/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/bananium @@ -229,7 +229,7 @@ paintable = FALSE /obj/machinery/door/airlock/bananium/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/tranquillite @@ -250,7 +250,7 @@ paintable = FALSE /obj/machinery/door/airlock/sandstone/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/wood @@ -260,7 +260,7 @@ paintable = FALSE /obj/machinery/door/airlock/wood/glass - opacity = 0 + opacity = FALSE glass = TRUE /obj/machinery/door/airlock/titanium @@ -273,7 +273,7 @@ /obj/machinery/door/airlock/titanium/glass normal_integrity = 350 - opacity = 0 + opacity = FALSE glass = TRUE ////////////////////////////////// @@ -287,7 +287,7 @@ assemblytype = /obj/structure/door_assembly/door_assembly_public /obj/machinery/door/airlock/public/glass - opacity = 0 + opacity = FALSE glass = TRUE ////////////////////////////////// @@ -305,7 +305,7 @@ doorClose = 'sound/machines/airlock_ext_close.ogg' /obj/machinery/door/airlock/external/glass - opacity = 0 + opacity = FALSE glass = TRUE ////////////////////////////////// @@ -316,7 +316,7 @@ /obj/machinery/door/airlock/centcom icon = 'icons/obj/doors/airlocks/centcom/centcom.dmi' overlays_file = 'icons/obj/doors/airlocks/centcom/overlays.dmi' - opacity = 1 + opacity = TRUE explosion_block = 2 assemblytype = /obj/structure/door_assembly/door_assembly_centcom normal_integrity = 1000 @@ -324,7 +324,7 @@ /obj/machinery/door/airlock/centcom/glass glass = TRUE - opacity = 0 + opacity = FALSE /obj/machinery/door/airlock/centcom/glass/Initialize() . = ..() @@ -582,7 +582,7 @@ /obj/machinery/door/airlock/cult/glass glass = TRUE - opacity = 0 + opacity = FALSE /obj/machinery/door/airlock/cult/glass/Initialize() . = ..() @@ -608,7 +608,7 @@ /obj/machinery/door/airlock/cult/unruned/glass glass = TRUE - opacity = 0 + opacity = FALSE /obj/machinery/door/airlock/cult/unruned/glass/Initialize() . = ..() @@ -644,5 +644,5 @@ return /obj/machinery/door/airlock/multi_tile/glass - opacity = 0 + opacity = FALSE glass = TRUE diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm index 0568dc3b454c..276a01ae16ed 100644 --- a/code/game/machinery/doors/alarmlock.dm +++ b/code/game/machinery/doors/alarmlock.dm @@ -2,9 +2,9 @@ name = "glass alarm airlock" icon = 'icons/obj/doors/airlocks/station2/glass.dmi' overlays_file = 'icons/obj/doors/airlocks/station2/overlays.dmi' - opacity = 0 - glass = 1 - autoclose = 0 + opacity = FALSE + glass = TRUE + autoclose = FALSE var/datum/radio_frequency/air_connection var/air_frequency = ATMOS_FIRE_FREQ @@ -34,8 +34,8 @@ if(alarm_area == our_area.name) switch(alert) if("severe") - autoclose = 1 + autoclose = TRUE close() if("minor", "clear") - autoclose = 0 + autoclose = FALSE open() diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 37670484c882..1693af08f6fa 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -18,12 +18,12 @@ icon_state = "frame" desc = "A remote control for a door." req_access = list(ACCESS_BRIG) - anchored = 1 // can't pick it up - density = 0 // can walk through it. + anchored = TRUE // can't pick it up + density = FALSE // can walk through it. layer = WALL_OBJ_LAYER var/id = null // id of door it controls. var/releasetime = 0 // when world.timeofday reaches it - release the prisoner - var/timing = 0 // boolean, true/1 timer is on, false/0 means it's not timing + var/timing = FALSE // boolean, true/1 timer is on, false/0 means it's not timing var/picture_state // icon_state of alert picture, if not displaying text/numbers var/list/obj/machinery/targets = list() var/timetoset = 0 // Used to set releasetime upon starting the timer @@ -119,7 +119,7 @@ GLOB.celltimers_list += src Radio = new /obj/item/radio(src) - Radio.listening = 0 + Radio.listening = FALSE Radio.config(list("Security" = 0)) Radio.follow_target = src return INITIALIZE_HINT_LATELOAD @@ -163,7 +163,7 @@ Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z)) occupant = CELL_NONE timer_end() // open doors, reset timer, clear status screen - timing = 0 + timing = FALSE . = PROCESS_KILL update_icon() else @@ -211,9 +211,9 @@ for(var/obj/machinery/treadmill_monitor/T in targets) T.total_joules = 0 - T.on = 1 + T.on = TRUE - return 1 + return TRUE // Opens and unlocks doors, power check @@ -244,15 +244,15 @@ continue if(C.opened) continue - C.locked = 0 + C.locked = FALSE C.icon_state = C.icon_closed for(var/obj/machinery/treadmill_monitor/T in targets) if(!T.stat) T.redeem() - T.on = 0 + T.on = FALSE - return 1 + return TRUE // Check for releasetime timeleft diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 974c27db45fd..558e4ab8aa4c 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -4,7 +4,7 @@ icon = 'icons/obj/doors/doorint.dmi' icon_state = "door1" anchored = TRUE - opacity = 1 + opacity = TRUE density = TRUE layer = OPEN_DOOR_LAYER power_channel = ENVIRON @@ -13,10 +13,10 @@ flags = PREVENT_CLICK_UNDER damage_deflection = 10 var/closingLayer = CLOSED_DOOR_LAYER - var/visible = 1 + var/visible = TRUE /// Is it currently in the process of opening or closing. var/operating = FALSE - var/autoclose = 0 + var/autoclose = FALSE /// Whether the door detects things and mobs in its way and reopen or crushes them. var/safe = TRUE // Whether the door is bolted or not. @@ -79,7 +79,7 @@ bound_height = width * world.icon_size /obj/machinery/door/Destroy() - density = 0 + density = FALSE air_update_turf(1) update_freelook_sight() GLOB.airlocks -= src @@ -256,8 +256,8 @@ flick("door_spark", src) sleep(6) open() - emagged = 1 - return 1 + emagged = TRUE + return TRUE /obj/machinery/door/update_icon() if(density) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 09f8e03fa046..f1d09a69a07e 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -9,7 +9,7 @@ desc = "A convenable firelock. Equipped with a manual lever for operating in case of emergency." icon = 'icons/obj/doors/doorfireglass.dmi' icon_state = "door_open" - opacity = 0 + opacity = FALSE density = FALSE max_integrity = 300 resistance_flags = FIRE_PROOF @@ -304,7 +304,7 @@ name = "heavy firelock" icon = 'icons/obj/doors/doorfire.dmi' glass = FALSE - opacity = 1 + opacity = TRUE explosion_block = 2 assemblytype = /obj/structure/firelock_frame/heavy max_integrity = 550 diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 66b00eacb9cb..be6880f5a3c0 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -18,7 +18,7 @@ /obj/machinery/door/poddoor/preopen icon_state = "open" density = FALSE - opacity = 0 + opacity = FALSE /obj/machinery/door/poddoor/impassable name = "reinforced blast door" diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index c2914262d15c..145b8c7b1ea6 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -11,7 +11,7 @@ /obj/machinery/door/poddoor/shutters/preopen icon_state = "open" density = FALSE - opacity = 0 + opacity = FALSE /obj/machinery/door/poddoor/shutters/radiation name = "radiation shutters" diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 3e62bcbad054..39d8fc9bbf1a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -6,16 +6,16 @@ layer = ABOVE_WINDOW_LAYER closingLayer = ABOVE_WINDOW_LAYER resistance_flags = ACID_PROOF - visible = 0 + visible = FALSE flags = ON_BORDER - opacity = 0 + opacity = FALSE dir = EAST max_integrity = 150 //If you change this, consider changing ../door/window/brigdoor/ max_integrity at the bottom of this .dm file integrity_failure = 0 armor = list(MELEE = 20, BULLET = 50, LASER = 50, ENERGY = 50, BOMB = 10, BIO = 100, RAD = 100, FIRE = 70, ACID = 100) var/obj/item/airlock_electronics/electronics var/base_state = "left" - var/reinf = 0 + var/reinf = FALSE var/shards = 2 var/rods = 2 var/cable = 1 @@ -170,14 +170,14 @@ playsound(loc, 'sound/machines/windowdoor.ogg', 100, 1) icon_state = base_state - density = 1 + density = TRUE // if(visible) // set_opacity(1) //TODO: why is this here? Opaque windoors? ~Carn air_update_turf(1) update_freelook_sight() sleep(10) - operating = 0 + operating = FALSE return 1 /obj/machinery/door/window/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0) @@ -332,7 +332,7 @@ icon_state = "leftsecure" base_state = "leftsecure" max_integrity = 300 //Stronger doors for prison (regular window door health is 200) - reinf = 1 + reinf = TRUE explosion_block = 1 var/id = null