diff --git a/code/__HELPERS/path.dm b/code/__HELPERS/path.dm index 5d1816e7e53..89f64cf9fb6 100644 --- a/code/__HELPERS/path.dm +++ b/code/__HELPERS/path.dm @@ -376,8 +376,9 @@ * * caller: The movable, if one exists, being used for mobility checks to see what tiles it can reach * * ID: An ID card that decides if we can gain access to doors that would otherwise block a turf * * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space? + * * no_id: When true, doors with public access will count as impassible */ -/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID) +/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID, no_id = FALSE) if(destination_turf.x != x && destination_turf.y != y) //diagonal var/in_dir = get_dir(destination_turf,src) // eg. northwest (1+8) = 9 (00001001) var/first_step_direction_a = in_dir & 3 // eg. north (1+8)&3 (0000 0011) = 1 (0000 0001) @@ -385,7 +386,7 @@ for(var/first_step_direction in list(first_step_direction_a,first_step_direction_b)) var/turf/midstep_turf = get_step(destination_turf,first_step_direction) - var/way_blocked = midstep_turf.density || LinkBlockedWithAccess(midstep_turf,caller,ID) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller,ID) + var/way_blocked = midstep_turf.density || LinkBlockedWithAccess(midstep_turf,caller,ID, no_id = no_id) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller,ID, no_id = no_id) if(!way_blocked) return FALSE return TRUE @@ -399,32 +400,32 @@ // if(destination_turf.density) // return TRUE if(TURF_PATHING_PASS_PROC) - if(!destination_turf.CanAStarPass(ID, actual_dir , caller)) + if(!destination_turf.CanAStarPass(ID, actual_dir , caller, no_id = no_id)) return TRUE if(TURF_PATHING_PASS_NO) return TRUE // Source border object checks for(var/obj/structure/window/iter_window in src) - if(!iter_window.CanAStarPass(ID, actual_dir)) + if(!iter_window.CanAStarPass(ID, actual_dir, no_id = no_id)) return TRUE for(var/obj/machinery/door/window/iter_windoor in src) - if(!iter_windoor.CanAStarPass(ID, actual_dir)) + if(!iter_windoor.CanAStarPass(ID, actual_dir, no_id = no_id)) return TRUE for(var/obj/structure/railing/iter_rail in src) - if(!iter_rail.CanAStarPass(ID, actual_dir)) + if(!iter_rail.CanAStarPass(ID, actual_dir, no_id = no_id)) return TRUE for(var/obj/machinery/door/firedoor/border_only/firedoor in src) - if(!firedoor.CanAStarPass(ID, actual_dir)) + if(!firedoor.CanAStarPass(ID, actual_dir, no_id = no_id)) return TRUE // Destination blockers check var/reverse_dir = get_dir(destination_turf, src) for(var/obj/iter_object in destination_turf) - if(!iter_object.CanAStarPass(ID, reverse_dir, caller)) + if(!iter_object.CanAStarPass(ID, reverse_dir, caller, no_id = no_id)) return TRUE return FALSE diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 149adbf4f01..ee9ff67cd46 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -2059,8 +2059,9 @@ * * ID- An ID card representing what access we have (and thus if we can open things like airlocks or windows to pass through them). The ID card's physical location does not matter, just the reference * * to_dir- What direction we're trying to move in, relevant for things like directional windows that only block movement in certain directions * * caller- The movable we're checking pass flags for, if we're making any such checks + * * no_id: When true, doors with public access will count as impassible **/ -/atom/proc/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/atom/proc/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) if(caller && (caller.pass_flags & pass_flags_self)) return TRUE . = !density diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 026d17a086c..d50f2ce665a 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1261,9 +1261,9 @@ assemblytype = initial(airlock.assemblytype) update_appearance() -/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) //Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off) - return !density || (check_access(ID) && !locked && hasPower()) + return !density || (check_access(ID) && !locked && hasPower() && !no_id) /obj/machinery/door/airlock/emag_act(mob/user, obj/item/card/emag/doorjack/D) if(!operating && density && hasPower() && !(obj_flags & EMAGGED)) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index 9023d66a9b9..3f90440257f 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -692,7 +692,7 @@ if(!(border_dir == dir)) //Make sure looking at appropriate border return TRUE -/obj/machinery/door/firedoor/border_only/CanAStarPass(obj/item/card/id/ID, to_dir) +/obj/machinery/door/firedoor/border_only/CanAStarPass(obj/item/card/id/ID, to_dir, no_id = FALSE) return !density || (dir != to_dir) /obj/machinery/door/firedoor/border_only/proc/on_exit(datum/source, atom/movable/leaving, direction) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 2012341a7bf..111dbc88e8b 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -180,8 +180,8 @@ return TRUE //used in the AStar algorithm to determinate if the turf the door is on is passable -/obj/machinery/door/window/CanAStarPass(obj/item/card/id/ID, to_dir) - return !density || (dir != to_dir) || (check_access(ID) && hasPower()) +/obj/machinery/door/window/CanAStarPass(obj/item/card/id/ID, to_dir, no_id = FALSE) + return !density || (dir != to_dir) || (check_access(ID) && hasPower() && !no_id) /obj/machinery/door/window/proc/on_exit(datum/source, atom/movable/leaving, direction) SIGNAL_HANDLER diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm index aa13d37e576..90451a5b0ae 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm @@ -131,7 +131,7 @@ if(!istype(location)) return FALSE - for(var/turf/spread_turf as anything in location.reachableAdjacentTurfs()) + for(var/turf/spread_turf as anything in location.reachableAdjacentTurfs(no_id = TRUE)) var/obj/effect/particle_effect/fluid/foam/foundfoam = locate() in spread_turf //Don't spread foam where there's already foam! if(foundfoam) continue diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index e69b6e77231..1d20dcdeb07 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -361,7 +361,7 @@ if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/projectile)) return prob(girderpasschance) -/obj/structure/girder/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/girder/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) . = !density if(caller) . = . || (caller.pass_flags & PASSGRILLE) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 02936b50c64..abc8c89277d 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -166,7 +166,7 @@ if(!. && istype(mover, /obj/projectile)) return prob(30) -/obj/structure/grille/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/grille/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) . = !density if(caller) . = . || (caller.pass_flags & PASSGRILLE) diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index 8379b2f0224..12e435b2932 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -62,7 +62,7 @@ return FALSE return TRUE -/obj/structure/plasticflaps/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/plasticflaps/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) if(isliving(caller)) if(isbot(caller)) return TRUE @@ -73,7 +73,7 @@ return FALSE if(caller?.pulling) - return CanAStarPass(ID, to_dir, caller.pulling) + return CanAStarPass(ID, to_dir, caller.pulling, no_id = no_id) return TRUE //diseases, stings, etc can pass diff --git a/code/game/objects/structures/railings.dm b/code/game/objects/structures/railings.dm index 0d570f8e18c..11cacfe9675 100644 --- a/code/game/objects/structures/railings.dm +++ b/code/game/objects/structures/railings.dm @@ -85,7 +85,7 @@ return . || mover.throwing || mover.movement_type & (FLYING | FLOATING) return TRUE -/obj/structure/railing/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/railing/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) if(!(to_dir & dir)) return TRUE return ..() diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 9b863f7ce69..912a9eea96c 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -127,7 +127,7 @@ if(locate(/obj/structure/table) in get_turf(mover)) return TRUE -/obj/structure/table/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/table/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) . = !density if(caller) . = . || (caller.pass_flags & PASSTABLE) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 295dd7e4165..20a9887fde9 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -371,7 +371,7 @@ /obj/structure/window/get_dumping_location() return null -/obj/structure/window/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/obj/structure/window/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) if(!density) return TRUE if(fulltile || (dir == to_dir)) diff --git a/code/game/turfs/open/openspace.dm b/code/game/turfs/open/openspace.dm index f2d890b5c63..6080997d07f 100644 --- a/code/game/turfs/open/openspace.dm +++ b/code/game/turfs/open/openspace.dm @@ -158,7 +158,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr /turf/open/openspace/rust_heretic_act() return FALSE -/turf/open/openspace/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) +/turf/open/openspace/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller, no_id = FALSE) if(caller && !caller.can_z_move(DOWN, src, null , ZMOVE_FALL_FLAGS)) //If we can't fall here (flying/lattice), it's fine to path through return TRUE return FALSE diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 36d5d42f270..6b943c33832 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -688,8 +688,9 @@ GLOBAL_LIST_EMPTY(station_turfs) * * caller: The movable, if one exists, being used for mobility checks to see what tiles it can reach * * ID: An ID card that decides if we can gain access to doors that would otherwise block a turf * * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space? + * * no_id: When true, doors with public access will count as impassible */ -/turf/proc/reachableAdjacentTurfs(caller, ID, simulated_only) +/turf/proc/reachableAdjacentTurfs(caller, ID, simulated_only, no_id = FALSE) var/static/space_type_cache = typecacheof(/turf/open/space) . = list() @@ -697,7 +698,7 @@ GLOBAL_LIST_EMPTY(station_turfs) var/turf/turf_to_check = get_step(src,iter_dir) if(!turf_to_check || (simulated_only && space_type_cache[turf_to_check.type])) continue - if(turf_to_check.density || LinkBlockedWithAccess(turf_to_check, caller, ID)) + if(turf_to_check.density || LinkBlockedWithAccess(turf_to_check, caller, ID, no_id = no_id)) continue . += turf_to_check