Canreach refactor (#93165)

## About The Pull Request
ports https://github.com/DaedalusDock/daedalusdock/pull/1144
ports https://github.com/DaedalusDock/daedalusdock/pull/1147

full credit to @Kapu1178 for the juice

instead of `reacher.CanReach(target)` we now do
`target.CanBeReachedBy(reacher)`, this allows us to give special
behavior to atoms which we want to reach, which is exactly what I need
for a feature I'm working on.
## Why It's Good For The Game
allows us to be more flexible with reachability
## Changelog
🆑
refactor: refactored how reaching items works, report any oddities with
being unable to reach something you should be able to!
/🆑
This commit is contained in:
die
2025-10-07 20:28:59 +02:00
committed by GitHub
parent c82cb1734d
commit 0204ab8fdd
69 changed files with 190 additions and 162 deletions
@@ -203,7 +203,7 @@
return
new_name = apply_text_macros(new_name)
var/obj/item/hitting_implement = (locate(/obj/item/reagent_containers/cup/glass/bottle) in user.held_items) || user.get_item_for_held_index(hand)
if(!user.CanReach(attacked, hitting_implement))
if(!attacked.IsReachableBy(user, hitting_implement.reach))
user.balloon_alert(user, "out of range!")
return
var/obj/item/reagent_containers/cup/glass/bottle/bottle = hitting_implement
@@ -212,7 +212,7 @@
return CLICK_ACTION_SUCCESS
/obj/machinery/computer/emergency_shuttle/proc/attempt_hijack_stage(mob/living/user)
if(!user.CanReach(src))
if(!IsReachableBy(user))
return
if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
to_chat(user, span_warning("You need your hands free before you can manipulate [src]."))