From 44b0a96676925b1de4115390f3ffd941ab098523 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Sun, 29 Oct 2023 00:11:22 +0200 Subject: [PATCH 01/10] Refactored filler turfs. --- code/game/machinery/doors/door.dm | 54 ++++++++++++-------- code/game/machinery/doors/multi_tile.dm | 37 -------------- code/game/machinery/doors/runed_sandstone.dm | 4 +- code/modules/shuttle/helpers.dm | 2 +- code/modules/shuttles/marine_ferry.dm | 2 +- 5 files changed, 36 insertions(+), 63 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 578ef368f5d9..976def20ccca 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -24,7 +24,8 @@ var/openspeed = 10 //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations var/heat_proof = 0 // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 - var/turf/filler //Fixes double door opacity issue + var/turf/filler_turfs = list() //Fixes double door opacity issue + //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey @@ -48,9 +49,9 @@ /obj/structure/machinery/door/Destroy() . = ..() - if(filler && width > 1) - filler.set_opacity(0)// Ehh... let's hope there are no walls there. Must fix this - filler = null + if(filler_turfs && width > 1) + change_filler_opacity(0) + filler_turfs = null density = FALSE /obj/structure/machinery/door/initialize_pass_flags(datum/pass_flags_container/PF) @@ -58,21 +59,35 @@ if (PF) PF.flags_can_pass_all = NONE +/obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) + for(var/turf/filler_turf in filler_turfs) + filler_turf.set_opacity(null) + + filler_turfs = list() + for(var/turf/filler in locate_filler_turfs()) + filler.set_opacity(new_opacity) + filler_turfs += filler + /obj/structure/machinery/door/proc/handle_multidoor() if(width > 1) if(dir in list(EAST, WEST)) bound_width = width * world.icon_size bound_height = world.icon_size - filler = get_step(src,EAST) - filler.set_opacity(opacity) else bound_width = world.icon_size bound_height = width * world.icon_size - filler = get_step(src,NORTH) - filler.set_opacity(opacity) - -//process() - //return + change_filler_opacity(opacity) + +/obj/structure/machinery/door/proc/locate_filler_turfs() + var/turf/filler_temp + . = list() + for(var/i = 1, i < width, i++) + if (dir in list(NORTH, SOUTH)) + filler_temp = locate(x, y + i, z) + else + filler_temp = locate(x + i, y, z) + if (filler_temp) + . += filler_temp /obj/structure/machinery/door/proc/borders_space() for(var/turf/target in range(1, src)) @@ -223,8 +238,8 @@ do_animate("opening") icon_state = "door0" set_opacity(FALSE) - if(filler) - filler.set_opacity(opacity) + if(filler_turfs) + change_filler_opacity(opacity) addtimer(CALLBACK(src, PROC_REF(finish_open)), openspeed) return TRUE @@ -256,8 +271,8 @@ update_icon() if(visible && !glass) set_opacity(TRUE) - if(filler) - filler.set_opacity(opacity) + if(filler_turfs) + change_filler_opacity(opacity) operating = FALSE /obj/structure/machinery/door/proc/requiresID() @@ -273,22 +288,17 @@ close() return +/// It WONT WORK with airlocks bigger than 2 tiles, also is wonky as hell /obj/structure/machinery/door/Move(new_loc, new_dir) . = ..() if(width > 1) if(dir in list(EAST, WEST)) bound_width = width * world.icon_size bound_height = world.icon_size - filler.set_opacity(0) - filler = (get_step(src,EAST)) //Find new turf - filler.set_opacity(opacity) else bound_width = world.icon_size bound_height = width * world.icon_size - filler.set_opacity(0) - filler = (get_step(src,NORTH)) //Find new turf - filler.set_opacity(opacity) - + change_filler_opacity(opacity) /obj/structure/machinery/door/morgue icon = 'icons/obj/structures/doors/doormorgue.dmi' diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index 65ecd67a438e..ecc145bff05f 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -137,7 +137,6 @@ /obj/structure/window/framed/almayer, /obj/structure/machinery/door/airlock, ) - var/multi_filler = list() /obj/structure/machinery/door/airlock/multi_tile/almayer/Initialize() . = ..() @@ -233,42 +232,6 @@ req_access = null req_one_access = list(ACCESS_CIVILIAN_BRIG, ACCESS_CIVILIAN_COMMAND, ACCESS_WY_COLONIAL) -/obj/structure/machinery/door/airlock/multi_tile/almayer/handle_multidoor() - . = ..() - if(!(width > 1)) return //Bubblewrap - - update_filler_turfs() - -//We have to find these again since these doors are used on shuttles a lot so the turfs changes -/obj/structure/machinery/door/airlock/multi_tile/almayer/proc/update_filler_turfs() - for(var/turf/T in multi_filler) - T.set_opacity(null) - - multi_filler = list() - for(var/turf/T in get_filler_turfs()) - T.set_opacity(opacity) - multi_filler += list(T) - -/obj/structure/machinery/door/airlock/multi_tile/proc/get_filler_turfs() - . = list() - for(var/i = 1, i < width, i++) - if(dir in list(NORTH, SOUTH)) - var/turf/T = locate(x, y + i, z) - if(T) - . += list(T) - else if(dir in list(EAST, WEST)) - var/turf/T = locate(x + i, y, z) - if(T) - . += list(T) - -/obj/structure/machinery/door/airlock/multi_tile/almayer/open() - . = ..() - update_filler_turfs() - -/obj/structure/machinery/door/airlock/multi_tile/almayer/close() - . = ..() - update_filler_turfs() - //------Dropship Cargo Doors -----// /obj/structure/machinery/door/airlock/multi_tile/almayer/dropshiprear diff --git a/code/game/machinery/doors/runed_sandstone.dm b/code/game/machinery/doors/runed_sandstone.dm index 4bf66dfdc8d8..acb105a2aa6c 100644 --- a/code/game/machinery/doors/runed_sandstone.dm +++ b/code/game/machinery/doors/runed_sandstone.dm @@ -110,8 +110,8 @@ density = FALSE update_icon() set_opacity(0) - if(filler) - filler.set_opacity(opacity) + if(filler_turfs) + change_filler_opacity(opacity) if(operating) operating = FALSE diff --git a/code/modules/shuttle/helpers.dm b/code/modules/shuttle/helpers.dm index 1d841581faa0..6ab5d88da1b7 100644 --- a/code/modules/shuttle/helpers.dm +++ b/code/modules/shuttle/helpers.dm @@ -117,7 +117,7 @@ var/list/door_turfs = list(get_turf(air)) if(istype(air, /obj/structure/machinery/door/airlock/multi_tile)) var/obj/structure/machinery/door/airlock/multi_tile/multi_door = air - door_turfs = multi_door.get_filler_turfs() + door_turfs = multi_door.locate_filler_turfs() for(var/turf/door_turf in door_turfs) bump_at_turf(door_turf) diff --git a/code/modules/shuttles/marine_ferry.dm b/code/modules/shuttles/marine_ferry.dm index 6d84881fe9bf..d98ef6024e75 100644 --- a/code/modules/shuttles/marine_ferry.dm +++ b/code/modules/shuttles/marine_ferry.dm @@ -58,7 +58,7 @@ for(var/obj/vehicle/multitile/M in D.loc) if(M) return 0 - for(var/turf/T in D.get_filler_turfs()) + for(var/turf/T in D.locate_filler_turfs()) for(var/obj/vehicle/multitile/M in T) if(M) return 0 From a2ad2ad5453d3650db149a028e0b4049a140b43d Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:59:57 +0100 Subject: [PATCH 02/10] Added some comments --- code/game/machinery/doors/door.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 976def20ccca..5a2a4ec6032f 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -24,8 +24,8 @@ var/openspeed = 10 //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations var/heat_proof = 0 // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 - var/turf/filler_turfs = list() //Fixes double door opacity issue - //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER + /// Fixes double door opacity issue + var/turf/filler_turfs = list() //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey @@ -50,7 +50,7 @@ /obj/structure/machinery/door/Destroy() . = ..() if(filler_turfs && width > 1) - change_filler_opacity(0) + change_filler_opacity(0) // It still doesn't check for walls, might want to add checking that in the future filler_turfs = null density = FALSE @@ -60,6 +60,7 @@ PF.flags_can_pass_all = NONE /obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) + // I have no idea why do we null opacity first before... changing it for(var/turf/filler_turf in filler_turfs) filler_turf.set_opacity(null) From 8819b88382ad59c4f60282ca50eefbb040114b82 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Thu, 2 Nov 2023 10:47:54 +0100 Subject: [PATCH 03/10] Fixed solid rear dropship airlock issue --- code/game/machinery/doors/door.dm | 9 +++++---- code/game/machinery/doors/runed_sandstone.dm | 2 +- code/modules/shuttle/shuttles/dropship.dm | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 5a2a4ec6032f..88281ba7cbb5 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -25,7 +25,7 @@ var/heat_proof = 0 // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 /// Fixes double door opacity issue - var/turf/filler_turfs = list() //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER + var/filler_turfs = list() //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey @@ -49,7 +49,7 @@ /obj/structure/machinery/door/Destroy() . = ..() - if(filler_turfs && width > 1) + if(length(filler_turfs) && width > 1) change_filler_opacity(0) // It still doesn't check for walls, might want to add checking that in the future filler_turfs = null density = FALSE @@ -59,6 +59,7 @@ if (PF) PF.flags_can_pass_all = NONE +/// Also refreshes filler_turfs list /obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) // I have no idea why do we null opacity first before... changing it for(var/turf/filler_turf in filler_turfs) @@ -239,7 +240,7 @@ do_animate("opening") icon_state = "door0" set_opacity(FALSE) - if(filler_turfs) + if(length(filler_turfs)) change_filler_opacity(opacity) addtimer(CALLBACK(src, PROC_REF(finish_open)), openspeed) return TRUE @@ -272,7 +273,7 @@ update_icon() if(visible && !glass) set_opacity(TRUE) - if(filler_turfs) + if(length(filler_turfs)) change_filler_opacity(opacity) operating = FALSE diff --git a/code/game/machinery/doors/runed_sandstone.dm b/code/game/machinery/doors/runed_sandstone.dm index acb105a2aa6c..a6de7348dd7f 100644 --- a/code/game/machinery/doors/runed_sandstone.dm +++ b/code/game/machinery/doors/runed_sandstone.dm @@ -110,7 +110,7 @@ density = FALSE update_icon() set_opacity(0) - if(filler_turfs) + if(length(filler_turfs)) change_filler_opacity(opacity) if(operating) diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index e1c2bb9a1f9a..1f5d78387967 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -55,6 +55,13 @@ /obj/docking_port/mobile/marine_dropship/proc/get_door_data() return door_control.get_data() +/// Is called on_departure and on_arrival to prevent transparent solid multitile airlocks +/obj/docking_port/mobile/marine_dropship/proc/refresh_multitile_airlock_filler_turfs() + for(var/place in shuttle_areas) + for(var/obj/structure/machinery/door/doors in place) + if(doors.width > 1) + doors.handle_multidoor() + /obj/docking_port/mobile/marine_dropship/Initialize(mapload) . = ..() door_control = new() @@ -217,6 +224,7 @@ var/obj/docking_port/mobile/marine_dropship/dropship = arriving_shuttle dropship.in_flyby = FALSE dropship.control_doors("unlock", "all", force=FALSE) + dropship.refresh_multitile_airlock_filler_turfs() var/obj/structure/machinery/computer/shuttle/dropship/flight/console = dropship.getControlConsole() console?.update_equipment() if(is_ground_level(z) && !SSobjectives.first_drop_complete) @@ -234,8 +242,9 @@ /obj/docking_port/stationary/marine_dropship/on_departure(obj/docking_port/mobile/departing_shuttle) . = ..() turn_off_landing_lights() - var/obj/docking_port/mobile/marine_dropship/shuttle = departing_shuttle - for(var/obj/structure/dropship_equipment/eq as anything in shuttle.equipments) + var/obj/docking_port/mobile/marine_dropship/dropship = departing_shuttle + dropship.refresh_multitile_airlock_filler_turfs() + for(var/obj/structure/dropship_equipment/eq as anything in dropship.equipments) eq.on_launch() /obj/docking_port/stationary/marine_dropship/lz1 @@ -271,6 +280,8 @@ /obj/docking_port/stationary/marine_dropship/crash_site/on_arrival(obj/docking_port/mobile/arriving_shuttle) . = ..() + var/obj/docking_port/mobile/marine_dropship/dropship = arriving_shuttle + dropship.refresh_multitile_airlock_filler_turfs() arriving_shuttle.mode = SHUTTLE_CRASHED for(var/mob/living/carbon/affected_mob in (GLOB.alive_human_list + GLOB.living_xeno_list)) //knock down mobs if(affected_mob.z != z) From 20ba5c7e4a15d06061b19ea4c5addc0d2add2f16 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:24:54 +0100 Subject: [PATCH 04/10] Some code cleaning --- code/game/machinery/doors/door.dm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 88281ba7cbb5..940e64a317f0 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -25,7 +25,8 @@ var/heat_proof = 0 // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 /// Fixes double door opacity issue - var/filler_turfs = list() //And of course, no one had forseen someone creating doors longer than 2, because that would NEVER happen, NEVER + var/list/filler_turfs = list() //Previously this was just a single turf, because no one had forseen someone creating doors longer than 2, + // because that would NEVER happen, NEVER /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey @@ -69,7 +70,7 @@ for(var/turf/filler in locate_filler_turfs()) filler.set_opacity(new_opacity) filler_turfs += filler - +/// Updates collision box and opacity of multi_tile airlocks /obj/structure/machinery/door/proc/handle_multidoor() if(width > 1) if(dir in list(EAST, WEST)) @@ -82,14 +83,16 @@ /obj/structure/machinery/door/proc/locate_filler_turfs() var/turf/filler_temp - . = list() + var/list/located_turfs = list() + for(var/i = 1, i < width, i++) - if (dir in list(NORTH, SOUTH)) - filler_temp = locate(x, y + i, z) - else + if (dir in list(EAST, WEST)) filler_temp = locate(x + i, y, z) + else + filler_temp = locate(x, y + i, z) if (filler_temp) - . += filler_temp + located_turfs += filler_temp + return located_turfs /obj/structure/machinery/door/proc/borders_space() for(var/turf/target in range(1, src)) From 9a086144c519a6e579b1356334d3e2b985e3d1c3 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Thu, 2 Nov 2023 22:59:35 +0100 Subject: [PATCH 05/10] Even more tidying up the code --- code/game/machinery/doors/door.dm | 20 ++++++++++---------- code/game/machinery/doors/multi_tile.dm | 1 - code/modules/shuttle/shuttles/dropship.dm | 1 + 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 940e64a317f0..4e384629f971 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -7,7 +7,7 @@ anchored = TRUE opacity = TRUE density = TRUE - throwpass = 0 + throwpass = FALSE layer = DOOR_OPEN_LAYER minimap_color = MINIMAP_DOOR var/open_layer = DOOR_OPEN_LAYER @@ -15,16 +15,17 @@ var/id = "" var/secondsElectrified = 0 - var/visible = 1 + var/visible = TRUE var/panel_open = FALSE - var/operating = 0 - var/autoclose = 0 - var/glass = 0 - var/normalspeed = 1 - var/openspeed = 10 //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations - var/heat_proof = 0 // For glass airlocks/opacity firedoors + var/operating = FALSE + var/autoclose = FALSE + var/glass = FALSE + /// If FALSE it speeds up the autoclosing timing + var/normalspeed = TRUE + var/openspeed = 1 SECONDS //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations + var/heat_proof = FALSE // For glass airlocks/opacity firedoors var/air_properties_vary_with_direction = 0 - /// Fixes double door opacity issue + /// Fixes multi_tile doors opacity issues var/list/filler_turfs = list() //Previously this was just a single turf, because no one had forseen someone creating doors longer than 2, // because that would NEVER happen, NEVER /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). @@ -45,7 +46,6 @@ update_flags_heat_protection(get_turf(src)) else layer = open_layer - handle_multidoor() /obj/structure/machinery/door/Destroy() diff --git a/code/game/machinery/doors/multi_tile.dm b/code/game/machinery/doors/multi_tile.dm index ecc145bff05f..ca218128160d 100644 --- a/code/game/machinery/doors/multi_tile.dm +++ b/code/game/machinery/doors/multi_tile.dm @@ -13,7 +13,6 @@ /obj/structure/machinery/door/airlock/multi_tile/Initialize() . = ..() - handle_multidoor() update_icon() /obj/structure/machinery/door/airlock/multi_tile/glass diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index 1f5d78387967..8c8f67aa0355 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -57,6 +57,7 @@ /// Is called on_departure and on_arrival to prevent transparent solid multitile airlocks /obj/docking_port/mobile/marine_dropship/proc/refresh_multitile_airlock_filler_turfs() +// Yes, there is 1 tick where you can see through solid airlocks, but it's the simplest solution I could've think of for(var/place in shuttle_areas) for(var/obj/structure/machinery/door/doors in place) if(doors.width > 1) From c45af465283c1ebfe3b1b2d49dd4a3f6bf8c30ac Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Sat, 4 Nov 2023 21:39:33 +0100 Subject: [PATCH 06/10] Removed unnecessary old code and cleaned it up --- code/game/machinery/doors/airlock_types.dm | 1 - code/game/machinery/doors/door.dm | 99 +++++++------------ code/game/machinery/doors/windowdoor.dm | 1 - .../shuttle/computers/escape_pod_computer.dm | 1 - 4 files changed, 37 insertions(+), 65 deletions(-) diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index f4d09796194c..feb699fd245e 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -138,7 +138,6 @@ opacity = 0 assembly_type = /obj/structure/airlock_assembly/airlock_assembly_research glass = 1 - heat_proof = 1 req_one_access = list(ACCESS_CIVILIAN_RESEARCH, ACCESS_CIVILIAN_COMMAND, ACCESS_WY_COLONIAL) /obj/structure/machinery/door/airlock/glass_mining/colony diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 4e384629f971..a574625f968b 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -1,4 +1,3 @@ - /obj/structure/machinery/door name = "\improper Door" desc = "It opens and closes." @@ -13,6 +12,7 @@ var/open_layer = DOOR_OPEN_LAYER var/closed_layer = DOOR_CLOSED_LAYER var/id = "" + var/width = 1 var/secondsElectrified = 0 var/visible = TRUE @@ -20,32 +20,22 @@ var/operating = FALSE var/autoclose = FALSE var/glass = FALSE - /// If FALSE it speeds up the autoclosing timing + /// If FALSE it speeds up the autoclosing timing. var/normalspeed = TRUE - var/openspeed = 1 SECONDS //How many seconds does it take to open it? Default 1 second. Use only if you have long door opening animations - var/heat_proof = FALSE // For glass airlocks/opacity firedoors - var/air_properties_vary_with_direction = 0 - /// Fixes multi_tile doors opacity issues - var/list/filler_turfs = list() //Previously this was just a single turf, because no one had forseen someone creating doors longer than 2, - // because that would NEVER happen, NEVER + /// Time to open/close airlock, default is 1 second. + var/openspeed = 1 SECONDS + /// Fixes multi_tile doors opacity issues. + var/list/filler_turfs = list() //Previously this was just var, because no one had forseen someone creating doors more than 2 tiles wide /// Stops it being forced open through normal means (Hunters/Zombies/Aliens). var/heavy = FALSE /// Resistance to masterkey var/masterkey_resist = FALSE var/masterkey_mod = 0.1 - - - //Multi-tile doors - dir = EAST - var/width = 1 + dir = EAST //So multitile doors are directioned properly /obj/structure/machinery/door/Initialize(mapload, ...) . = ..() - if(density) - layer = closed_layer - update_flags_heat_protection(get_turf(src)) - else - layer = open_layer + layer = density ? closed_layer : open_layer handle_multidoor() /obj/structure/machinery/door/Destroy() @@ -60,7 +50,7 @@ if (PF) PF.flags_can_pass_all = NONE -/// Also refreshes filler_turfs list +/// Also refreshes filler_turfs list. /obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) // I have no idea why do we null opacity first before... changing it for(var/turf/filler_turf in filler_turfs) @@ -70,7 +60,8 @@ for(var/turf/filler in locate_filler_turfs()) filler.set_opacity(new_opacity) filler_turfs += filler -/// Updates collision box and opacity of multi_tile airlocks + +/// Updates collision box and opacity of multi_tile airlocks. /obj/structure/machinery/door/proc/handle_multidoor() if(width > 1) if(dir in list(EAST, WEST)) @@ -81,6 +72,7 @@ bound_height = width * world.icon_size change_filler_opacity(opacity) +/// Finds turfs which should be filler ones. /obj/structure/machinery/door/proc/locate_filler_turfs() var/turf/filler_temp var/list/located_turfs = list() @@ -101,7 +93,8 @@ return FALSE /obj/structure/machinery/door/Collided(atom/movable/AM) - if(panel_open || operating) return + if(panel_open || operating) + return if(ismob(AM)) var/mob/M = AM if(world.time - M.last_bumped <= openspeed) return //Can bump-open one airlock per second. This is to prevent shock spam. @@ -109,12 +102,10 @@ if(!M.is_mob_restrained() && M.mob_size > MOB_SIZE_SMALL) bumpopen(M) return - if(istype(AM, /obj)) var/obj/O = AM if(O.buckled_mob) Collided(O.buckled_mob) - if(istype(AM, /obj/structure/machinery/bot)) var/obj/structure/machinery/bot/bot = AM if(src.check_access(bot.botcard)) @@ -122,16 +113,17 @@ open() return - /obj/structure/machinery/door/proc/bumpopen(mob/user as mob) - if(operating) return + if(operating) + return src.add_fingerprint(user) if(!src.requiresID()) user = null - if(density) - if(allowed(user)) open() - else flick("door_deny", src) + if(allowed(user)) + open() + else + flick("door_deny", src) return /obj/structure/machinery/door/attack_remote(mob/user) @@ -144,9 +136,7 @@ add_fingerprint(user) if(operating) return - if(!Adjacent(user)) - user = null //so allowed(user) always succeeds - if(!requiresID()) + if(!Adjacent(user) || !requiresID()) user = null //so allowed(user) always succeeds if(allowed(user)) if(density) @@ -157,15 +147,15 @@ if(density) flick("door_deny", src) - /obj/structure/machinery/door/attackby(obj/item/I, mob/user) if(!(I.flags_item & NOBLUDGEON)) try_to_activate_door(user) - return 1 + return TRUE /obj/structure/machinery/door/emp_act(severity) - if(prob(20/severity) && (istype(src,/obj/structure/machinery/door/airlock) || istype(src,/obj/structure/machinery/door/window)) ) - open() + if(prob(20/severity)) + if((istype(src, /obj/structure/machinery/door/airlock) || istype(src, /obj/structure/machinery/door/window))) + open() if(prob(40/severity)) if(secondsElectrified == 0) secondsElectrified = -1 @@ -173,48 +163,41 @@ secondsElectrified = 0 ..() - /obj/structure/machinery/door/ex_act(severity) - if(unacidable) return + if(unacidable) + return if(density) switch(severity) if(0 to EXPLOSION_THRESHOLD_LOW) if(prob(80)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, src) - s.start() + var/datum/effect_system/spark_spread/spark = new /datum/effect_system/spark_spread + spark.set_up(2, 1, src) + spark.start() if(EXPLOSION_THRESHOLD_LOW to INFINITY) qdel(src) else switch(severity) if(0 to EXPLOSION_THRESHOLD_MEDIUM) if(prob(80)) - var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread - s.set_up(2, 1, src) - s.start() + var/datum/effect_system/spark_spread/spark = new /datum/effect_system/spark_spread + spark.set_up(2, 1, src) + spark.start() else qdel(src) return - /obj/structure/machinery/door/get_explosion_resistance() if(density) if(unacidable) - return 1000000 + return 1000000 //I have no idea why do we use magic number here... else return EXPLOSION_THRESHOLD_LOW //this should exactly match the amount of damage needed to destroy the door else return 0 - /obj/structure/machinery/door/update_icon() - if(density) - icon_state = "door1" - else - icon_state = "door0" - return - + icon_state = density ? "door1" : "door0" /obj/structure/machinery/door/proc/do_animate(animation) switch(animation) @@ -232,7 +215,6 @@ flick("door_deny", src) return - /obj/structure/machinery/door/proc/open(forced=0) if(!density) return TRUE @@ -255,11 +237,9 @@ if(operating) operating = FALSE - if(autoclose) addtimer(CALLBACK(src, PROC_REF(autoclose)), normalspeed ? 150 + openspeed : 5) - /obj/structure/machinery/door/proc/close() if(density) return TRUE @@ -283,17 +263,12 @@ /obj/structure/machinery/door/proc/requiresID() return TRUE - -/obj/structure/machinery/door/proc/update_flags_heat_protection(turf/source) - - /obj/structure/machinery/door/proc/autoclose() - var/obj/structure/machinery/door/airlock/A = src - if(!A.density && !A.operating && !A.locked && !A.welded && A.autoclose) + var/obj/structure/machinery/door/airlock/airlock = src + if(!airlock.density && !airlock.operating && !airlock.locked && !airlock.welded && airlock.autoclose) close() return -/// It WONT WORK with airlocks bigger than 2 tiles, also is wonky as hell /obj/structure/machinery/door/Move(new_loc, new_dir) . = ..() if(width > 1) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2b57fbd0a44d..bd544c5c3f5a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -11,7 +11,6 @@ flags_atom = ON_BORDER opacity = FALSE var/obj/item/circuitboard/airlock/electronics = null - air_properties_vary_with_direction = 1 /obj/structure/machinery/door/window/Initialize() . = ..() diff --git a/code/modules/shuttle/computers/escape_pod_computer.dm b/code/modules/shuttle/computers/escape_pod_computer.dm index 6f9292cfc048..99478dcf6884 100644 --- a/code/modules/shuttle/computers/escape_pod_computer.dm +++ b/code/modules/shuttle/computers/escape_pod_computer.dm @@ -204,7 +204,6 @@ /obj/structure/machinery/door/airlock/evacuation name = "\improper Evacuation Airlock" icon = 'icons/obj/structures/doors/pod_doors.dmi' - heat_proof = 1 unslashable = TRUE unacidable = TRUE var/obj/docking_port/mobile/crashable/escape_shuttle/linked_shuttle From 9cd8b705e94f3d084018ab5a3b1baa6540271c52 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Sun, 5 Nov 2023 02:27:16 +0100 Subject: [PATCH 07/10] Changed comment --- code/game/machinery/doors/door.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index a574625f968b..98f305fe95d4 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -190,7 +190,7 @@ /obj/structure/machinery/door/get_explosion_resistance() if(density) if(unacidable) - return 1000000 //I have no idea why do we use magic number here... + return 1000000 //Used for negation of explosions, should probably be made into define in the future else return EXPLOSION_THRESHOLD_LOW //this should exactly match the amount of damage needed to destroy the door else From 67b73f68fe91f4cc810cc14de74d4037b9ffed52 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:39:24 +0100 Subject: [PATCH 08/10] Implemented changes --- code/game/machinery/doors/airlock.dm | 5 +++++ code/game/machinery/doors/door.dm | 24 ++++++++++++++--------- code/modules/shuttle/shuttles/dropship.dm | 12 ------------ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index b7257ff4e7d3..c6d9ddf3efbd 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -866,3 +866,8 @@ GLOBAL_LIST_INIT(airlock_wire_descriptions, list( var/damage = xeno.melee_damage_upper * TAILSTAB_AIRLOCK_DAMAGE_MULTIPLIER take_damage(damage, xeno) return TAILSTAB_COOLDOWN_NORMAL + +/obj/structure/machinery/door/airlock/autoclose() + if(locked) + return + ..() diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 98f305fe95d4..ecf1d3b76e85 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -53,11 +53,11 @@ /// Also refreshes filler_turfs list. /obj/structure/machinery/door/proc/change_filler_opacity(new_opacity) // I have no idea why do we null opacity first before... changing it - for(var/turf/filler_turf in filler_turfs) + for(var/turf/filler_turf as anything in filler_turfs) filler_turf.set_opacity(null) filler_turfs = list() - for(var/turf/filler in locate_filler_turfs()) + for(var/turf/filler as anything in locate_filler_turfs()) filler.set_opacity(new_opacity) filler_turfs += filler @@ -77,7 +77,7 @@ var/turf/filler_temp var/list/located_turfs = list() - for(var/i = 1, i < width, i++) + for(var/i = 1 in 1 to width-1) if (dir in list(EAST, WEST)) filler_temp = locate(x + i, y, z) else @@ -116,8 +116,8 @@ /obj/structure/machinery/door/proc/bumpopen(mob/user as mob) if(operating) return - src.add_fingerprint(user) - if(!src.requiresID()) + add_fingerprint(user) + if(!requiresID()) user = null if(density) if(allowed(user)) @@ -154,7 +154,7 @@ /obj/structure/machinery/door/emp_act(severity) if(prob(20/severity)) - if((istype(src, /obj/structure/machinery/door/airlock) || istype(src, /obj/structure/machinery/door/window))) + if(use_power) open() if(prob(40/severity)) if(secondsElectrified == 0) @@ -263,11 +263,12 @@ /obj/structure/machinery/door/proc/requiresID() return TRUE +/// Used for overriding in airlocks /obj/structure/machinery/door/proc/autoclose() - var/obj/structure/machinery/door/airlock/airlock = src - if(!airlock.density && !airlock.operating && !airlock.locked && !airlock.welded && airlock.autoclose) + if(!autoclose) + return + if(!density && !operating) close() - return /obj/structure/machinery/door/Move(new_loc, new_dir) . = ..() @@ -280,5 +281,10 @@ bound_height = width * world.icon_size change_filler_opacity(opacity) +/obj/structure/machinery/door/afterShuttleMove(turf/oldT, list/movement_force, shuttle_dir, shuttle_preferred_direction, move_dir, rotation) + . = ..() + // Yes, for a split second after departure you can see through rear dropship airlocks, but it's the simplest solution I could've think of + handle_multidoor() + /obj/structure/machinery/door/morgue icon = 'icons/obj/structures/doors/doormorgue.dmi' diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index 8c8f67aa0355..ee91c9b9e5d4 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -55,14 +55,6 @@ /obj/docking_port/mobile/marine_dropship/proc/get_door_data() return door_control.get_data() -/// Is called on_departure and on_arrival to prevent transparent solid multitile airlocks -/obj/docking_port/mobile/marine_dropship/proc/refresh_multitile_airlock_filler_turfs() -// Yes, there is 1 tick where you can see through solid airlocks, but it's the simplest solution I could've think of - for(var/place in shuttle_areas) - for(var/obj/structure/machinery/door/doors in place) - if(doors.width > 1) - doors.handle_multidoor() - /obj/docking_port/mobile/marine_dropship/Initialize(mapload) . = ..() door_control = new() @@ -225,7 +217,6 @@ var/obj/docking_port/mobile/marine_dropship/dropship = arriving_shuttle dropship.in_flyby = FALSE dropship.control_doors("unlock", "all", force=FALSE) - dropship.refresh_multitile_airlock_filler_turfs() var/obj/structure/machinery/computer/shuttle/dropship/flight/console = dropship.getControlConsole() console?.update_equipment() if(is_ground_level(z) && !SSobjectives.first_drop_complete) @@ -244,7 +235,6 @@ . = ..() turn_off_landing_lights() var/obj/docking_port/mobile/marine_dropship/dropship = departing_shuttle - dropship.refresh_multitile_airlock_filler_turfs() for(var/obj/structure/dropship_equipment/eq as anything in dropship.equipments) eq.on_launch() @@ -281,8 +271,6 @@ /obj/docking_port/stationary/marine_dropship/crash_site/on_arrival(obj/docking_port/mobile/arriving_shuttle) . = ..() - var/obj/docking_port/mobile/marine_dropship/dropship = arriving_shuttle - dropship.refresh_multitile_airlock_filler_turfs() arriving_shuttle.mode = SHUTTLE_CRASHED for(var/mob/living/carbon/affected_mob in (GLOB.alive_human_list + GLOB.living_xeno_list)) //knock down mobs if(affected_mob.z != z) From e3433f282104db0505f3850f9c75d096ec880cc9 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Mon, 6 Nov 2023 20:35:22 +0100 Subject: [PATCH 09/10] Fixed formatting --- code/game/machinery/doors/door.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index ecf1d3b76e85..747bdadd5590 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,7 +77,7 @@ var/turf/filler_temp var/list/located_turfs = list() - for(var/i = 1 in 1 to width-1) + for(var/i = 1 in 1 to width - 1) if (dir in list(EAST, WEST)) filler_temp = locate(x + i, y, z) else From e22d282aeb43df9c25afd8175e983206951ef1f8 Mon Sep 17 00:00:00 2001 From: Das15 <62486730+Das15@users.noreply.github.com> Date: Mon, 6 Nov 2023 21:30:58 +0100 Subject: [PATCH 10/10] Fixed an error --- code/game/machinery/doors/door.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 747bdadd5590..0c008dbb03b8 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -77,7 +77,7 @@ var/turf/filler_temp var/list/located_turfs = list() - for(var/i = 1 in 1 to width - 1) + for(var/i in 1 to width - 1) if (dir in list(EAST, WEST)) filler_temp = locate(x + i, y, z) else