From 6bf89dd257cbaf6c45ec1992fb87a71b32bae175 Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Mon, 22 May 2023 16:04:52 -0400 Subject: [PATCH] Check if on the same turf (#20998) --- code/modules/antagonists/changeling/powers/tiny_prick.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index f32539d192f..3f9f5915114 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -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, "Our target is too far for our sting!") 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, "Our sting is blocked from reaching our target!") return FALSE if(!cling.chosen_sting)