mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 03:25:49 +01:00
Check if on the same turf (#20998)
This commit is contained in:
@@ -43,10 +43,11 @@
|
||||
/datum/action/changeling/sting/can_sting(mob/user, mob/target)
|
||||
if(!..() || !iscarbon(target) || !isturf(user.loc))
|
||||
return FALSE
|
||||
if(get_dist(user, target) > cling.sting_range) // Too far, don't bother pathfinding
|
||||
var/target_distance = get_dist(user, target)
|
||||
if(target_distance > cling.sting_range) // Too far, don't bother pathfinding
|
||||
to_chat(user, "<span class='warning'>Our target is too far for our sting!</span>")
|
||||
return FALSE
|
||||
if(!length(get_path_to(user, target, max_distance = cling.sting_range, simulated_only = FALSE, skip_first = FALSE)))
|
||||
if(target_distance && !length(get_path_to(user, target, max_distance = cling.sting_range, simulated_only = FALSE, skip_first = FALSE))) // If they're not on the same turf, check if it can even reach them.
|
||||
to_chat(user, "<span class='warning'>Our sting is blocked from reaching our target!</span>")
|
||||
return FALSE
|
||||
if(!cling.chosen_sting)
|
||||
|
||||
Reference in New Issue
Block a user