From d324980d4079d8d6c27b41c4c08b08017da48208 Mon Sep 17 00:00:00 2001 From: Evandorf Date: Sun, 6 Apr 2025 18:10:33 -0500 Subject: [PATCH] Fixes Chainlink Fence Pathing (#20677) Fixes an issue where you could not walk on the tile where a chainlink fence existed. Altered the passing code and added some flags to ensure it would check direction. @RustingWithYou I tested it several times to make sure that it could not be lept. It seemed the intention was for it to never be passable so nothing living is able to move through it in this configuration. I left the probability for projectiles to sometimes not pass. --- code/game/objects/structures/urban.dm | 17 +++--- html/changelogs/Evandorf-ChainlinkPassing.yml | 58 +++++++++++++++++++ 2 files changed, 65 insertions(+), 10 deletions(-) create mode 100644 html/changelogs/Evandorf-ChainlinkPassing.yml diff --git a/code/game/objects/structures/urban.dm b/code/game/objects/structures/urban.dm index 8c0d18ff509..dab142a99f7 100644 --- a/code/game/objects/structures/urban.dm +++ b/code/game/objects/structures/urban.dm @@ -520,24 +520,21 @@ ABSTRACT_TYPE(/obj/structure/stairs/urban/road_ramp) color = null anchored = TRUE can_be_unanchored = FALSE + atom_flags = ATOM_FLAG_CHECKS_BORDER + layer = ABOVE_HUMAN_LAYER //The sprite will be in front of players when positioned correctly. /obj/structure/chainlink_fence/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. if(mover?.movement_type & PHASING) return TRUE - if(air_group || (height==0)) - return TRUE if(istype(mover, /obj/projectile)) - var/obj/projectile/P = mover - if(P.original == src) + if(isliving(mover)) return FALSE - if(P.firer && Adjacent(P.firer)) - return TRUE return prob(35) - if(isliving(mover)) - return FALSE - if(istype(mover) && mover.pass_flags & PASSTABLE) + if(!istype(mover) || mover.pass_flags & PASSGRILLE) return TRUE - return FALSE + if(get_dir(loc, target) == dir) + return !density + return TRUE /obj/structure/chainlink_fence/CheckExit(var/atom/movable/O, var/turf/target) if(istype(O) && CanPass(O, target)) diff --git a/html/changelogs/Evandorf-ChainlinkPassing.yml b/html/changelogs/Evandorf-ChainlinkPassing.yml new file mode 100644 index 00000000000..753077223cd --- /dev/null +++ b/html/changelogs/Evandorf-ChainlinkPassing.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Evandorf + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Makes the open sides of the chainlink fence passable."