diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index ff1ee01e4be..c6fbb930190 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -28234,6 +28234,9 @@ /obj/structure/disposalpipe/segment{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-right" + }, /turf/open/floor/iron/dark, /area/command/bridge) "hmM" = ( @@ -31376,6 +31379,9 @@ /obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, /obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4, /obj/structure/cable, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-left" + }, /turf/open/floor/iron/dark, /area/command/bridge) "ixK" = ( @@ -40658,6 +40664,9 @@ /obj/effect/turf_decal/trimline/blue/filled/line{ dir = 1 }, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-left" + }, /turf/open/floor/iron/dark, /area/command/bridge) "lOl" = ( @@ -45709,6 +45718,9 @@ /obj/effect/turf_decal/trimline/blue/filled/line{ dir = 4 }, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-right" + }, /turf/open/floor/iron/dark, /area/command/bridge) "nPQ" = ( @@ -46586,6 +46598,9 @@ dir = 4 }, /obj/structure/cable, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-left" + }, /turf/open/floor/iron/dark, /area/command/bridge) "ohf" = ( @@ -54489,6 +54504,9 @@ /obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2, /obj/structure/cable, /obj/structure/disposalpipe/segment, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-right" + }, /turf/open/floor/iron/dark, /area/command/bridge) "raw" = ( @@ -56134,6 +56152,20 @@ }, /turf/open/floor/engine, /area/engineering/supermatter/room) +"rHC" = ( +/obj/machinery/door/airlock/command/glass{ + name = "Bridge Access"; + req_access_txt = "19" + }, +/obj/machinery/door/firedoor, +/obj/effect/turf_decal/trimline/blue/filled/line{ + dir = 1 + }, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-right" + }, +/turf/open/floor/iron/dark, +/area/command/bridge) "rHD" = ( /obj/effect/turf_decal/stripes{ dir = 1 @@ -60477,6 +60509,9 @@ /obj/effect/turf_decal/trimline/blue/filled/line{ dir = 8 }, +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{ + cycle_id = "bridge-left" + }, /turf/open/floor/iron/dark, /area/command/bridge) "toF" = ( @@ -173152,7 +173187,7 @@ ydp cun vGu vGu -lOg +rHC hmH vGu fsN diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 2bbda8324bc..406c3ad4a3b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -112,6 +112,7 @@ var/aiHacking = FALSE var/closeOtherId //Cyclelinking for airlocks that aren't on the same x or y coord as the target. var/obj/machinery/door/airlock/closeOther + var/list/obj/machinery/door/airlock/close_others = list() var/obj/item/electronics/airlock/electronics COOLDOWN_DECLARE(shockCooldown) var/obj/item/note //Any papers pinned to the airlock @@ -148,9 +149,6 @@ wires = set_wires() if(frequency) set_frequency(frequency) - - if(closeOtherId != null) - addtimer(CALLBACK(.proc/update_other_id), 5) if(glass) airlock_material = "glass" if(security_level > AIRLOCK_SECURITY_IRON) @@ -181,6 +179,8 @@ . = ..() if (cyclelinkeddir) cyclelinkairlock() + if(closeOtherId) + update_other_id() if(abandoned) var/outcome = rand(1,100) switch(outcome) @@ -212,10 +212,9 @@ id_tag = "[port.id]_[id_tag]" /obj/machinery/door/airlock/proc/update_other_id() - for(var/obj/machinery/door/airlock/A in GLOB.airlocks) - if(A.closeOtherId == closeOtherId && A != src) - closeOther = A - break + for(var/obj/machinery/door/airlock/Airlock in GLOB.airlocks) + if(Airlock.closeOtherId == closeOtherId && Airlock != src) + close_others += Airlock /obj/machinery/door/airlock/proc/cyclelinkairlock() if (cyclelinkedairlock) @@ -350,6 +349,11 @@ if (cyclelinkedairlock.cyclelinkedairlock == src) cyclelinkedairlock.cyclelinkedairlock = null cyclelinkedairlock = null + if(close_others) //remove this airlock from the list of every linked airlock + closeOtherId = null + for(var/obj/machinery/door/airlock/otherlock as anything in close_others) + otherlock.close_others -= src + close_others.Cut() if(id_tag) for(var/obj/machinery/door_buttons/D in GLOB.machines) D.removeMe(src) @@ -376,8 +380,15 @@ if(!C.wearing_shock_proof_gloves()) new /datum/hallucination/shock(C) return - if (cyclelinkedairlock) - if (!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user)) + if(close_others) + for(var/obj/machinery/door/airlock/otherlock as anything in close_others) + if(!shuttledocked && !emergency && !otherlock.shuttledocked && !otherlock.emergency && allowed(user)) + if(otherlock.operating) + otherlock.delayed_close_requested = TRUE + else + addtimer(CALLBACK(otherlock, .proc/close), 2) + if(cyclelinkedairlock) + if(!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user)) if(cyclelinkedairlock.operating) cyclelinkedairlock.delayed_close_requested = TRUE else diff --git a/code/modules/mapping/mapping_helpers.dm b/code/modules/mapping/mapping_helpers.dm index 3fe9e2ce7e0..610cd5209cb 100644 --- a/code/modules/mapping/mapping_helpers.dm +++ b/code/modules/mapping/mapping_helpers.dm @@ -126,6 +126,16 @@ else airlock.cyclelinkeddir = dir +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi + name = "airlock multi-cyclelink helper" + icon_state = "airlock_multicyclelink_helper" + var/cycle_id + +/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi/payload(obj/machinery/door/airlock/airlock) + if(airlock.closeOtherId) + log_mapping("[src] at [AREACOORD(src)] tried to set [airlock] closeOtherId, but it's already set!") + else + airlock.closeOtherId = cycle_id /obj/effect/mapping_helpers/airlock/locked name = "airlock lock helper" diff --git a/icons/effects/mapping_helpers.dmi b/icons/effects/mapping_helpers.dmi index b4f0d5d11f0..9fdb07f9e0b 100644 Binary files a/icons/effects/mapping_helpers.dmi and b/icons/effects/mapping_helpers.dmi differ