mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
[NO GBP] Fixes tethers being able to move immovable objects (and delete gravgens) (#87911)
## About The Pull Request Closes #87203 Forgot that move_force was a thing ## Changelog 🆑 fix: Fixed tethers being able to move immovable objects (and delete gravgens) /🆑
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user