From c2e1ab080c0b3a23bafcd4e762abc79dd75d8418 Mon Sep 17 00:00:00 2001 From: Kaostico Date: Mon, 17 Jun 2024 17:44:50 -0300 Subject: [PATCH] Transcendent Olfaction fix: Pesky closets (#83993) ## About The Pull Request Change to using the more robust get_turf method to get locations, as all pinpointers currently do. ## Why It's Good For The Game The transcendent olfaction mutation is currently broken. When the target is inside a container, its x y z becomes zero, so it will always say the target is below you when comparing your z level to it, and it won't even point in the right direction. This PR fixes that. ## Changelog :cl: fix: Transcendent Olfaction mutation now works properly /:cl: --- code/datums/mutations/olfaction.dm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/datums/mutations/olfaction.dm b/code/datums/mutations/olfaction.dm index 305f6d16e83..6328345f1c4 100644 --- a/code/datums/mutations/olfaction.dm +++ b/code/datums/mutations/olfaction.dm @@ -119,6 +119,9 @@ /// Actually go through and give the user a hint of the direction our target is. /datum/action/cooldown/spell/olfaction/proc/on_the_trail(mob/living/caster) var/mob/living/carbon/current_target = tracking_ref?.resolve() + //Using get_turf to deal with those pesky closets that put your x y z to 0 + var/turf/current_target_turf = get_turf(current_target) + var/turf/caster_turf = get_turf(caster) if(!current_target) to_chat(caster, span_warning("You're not tracking a scent, but the game thought you were. \ Something's gone wrong! Report this as a bug.")) @@ -130,14 +133,14 @@ to_chat(caster, span_warning("You smell out the trail to yourself. Yep, it's you.")) return - if(caster.z < current_target.z) + if(caster_turf.z < current_target_turf.z) to_chat(caster, span_warning("The trail leads... way up above you? Huh. They must be really, really far away.")) return - else if(caster.z > current_target.z) + else if(caster_turf.z > current_target_turf.z) to_chat(caster, span_warning("The trail leads... way down below you? Huh. They must be really, really far away.")) return - var/direction_text = span_bold("[dir2text(get_dir(caster, current_target))]") + var/direction_text = span_bold("[dir2text(get_dir(caster_turf, current_target_turf))]") if(direction_text) to_chat(caster, span_notice("You consider [current_target]'s scent. The trail leads [direction_text]."))