From a17b6d8d9fe3637ff8a4c600077a9a55f6ab4ff5 Mon Sep 17 00:00:00 2001 From: Waterpig <49160555+Majkl-J@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:33:53 +0100 Subject: [PATCH] [NO GBP] Fixes tethers being able to move immovable objects (and dele (#2678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …te gravgens) (#87911) ## About The Pull Request See https://github.com/tgstation/tgstation/pull/87911 Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> --- code/datums/components/tether.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/datums/components/tether.dm b/code/datums/components/tether.dm index 1e8313fa53b2b..b9eb40647acd1 100644 --- a/code/datums/components/tether.dm +++ b/code/datums/components/tether.dm @@ -72,9 +72,11 @@ to_chat(source, span_warning("[tether_name] prevents you from entering [new_loc]!")) return COMPONENT_MOVABLE_BLOCK_PRE_MOVE + // If this was called, we know its a movable + var/atom/movable/movable_source = source var/atom/movable/anchor = (source == tether_target ? parent : tether_target) if (get_dist(anchor, new_loc) > cur_dist) - if (!istype(anchor) || anchor.anchored || !anchor.Move(get_step_towards(anchor, new_loc))) + if (!istype(anchor) || anchor.anchored || !(!anchor.anchored && anchor.move_resist <= movable_source.move_force && anchor.Move(get_step_towards(anchor, new_loc)))) to_chat(source, span_warning("[tether_name] runs out of slack and prevents you from moving!")) return COMPONENT_MOVABLE_BLOCK_PRE_MOVE @@ -105,7 +107,6 @@ if (get_dist(anchor, new_loc) != cur_dist || !ismovable(source)) return - var/atom/movable/movable_source = source var/datum/drift_handler/handler = movable_source.drift_handler if (isnull(handler)) return @@ -179,12 +180,12 @@ var/atom/movable/movable_parent = parent var/atom/movable/movable_target = tether_target - if (istype(movable_parent) && movable_parent.Move(get_step(movable_parent.loc, get_dir(movable_parent, movable_target)))) + if (istype(movable_parent) && !movable_parent.anchored && movable_parent.move_resist <= movable_target.move_force && movable_parent.Move(get_step(movable_parent.loc, get_dir(movable_parent, movable_target)))) cur_dist -= 1 location.balloon_alert(user, "tether shortened") return - if (istype(movable_target) && movable_target.Move(get_step(movable_target.loc, get_dir(movable_target, movable_parent)))) + if (istype(movable_target) && !movable_target.anchored && movable_target.move_resist <= movable_parent.move_force && movable_target.Move(get_step(movable_target.loc, get_dir(movable_target, movable_parent)))) cur_dist -= 1 location.balloon_alert(user, "tether shortened") return