From 96b8a39008cb4d84c75397a2744d3ebb45d6de63 Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:37:52 +0300 Subject: [PATCH] Circuit health analyzer/state components now work on targets inside lockers (#85649) ## About The Pull Request Makes circuit health analyzer/scanner components check distance to target turf instead of target itself similarly to (most) other components. (There are exceptions, presumably due to balancing? concerns, but this feels like it should not have been one) This doesn't feel intentional so I marked it as a fix, given that BCIs stopping being able to scan their occupant is rather nonsensical ## Why It's Good For The Game Currently BCIs with health analyzer components stop working if the owner goes into a locker which is pretty stupid. Most components also only check for turf distance, and while this could theoretically be used to pinpoint someone's hiding spot there are far better ways to do so with circuits ## Changelog :cl: fix: Circuit health analyzer/state components now work on targets inside lockers /:cl: --- code/modules/wiremod/components/atom/health.dm | 3 ++- code/modules/wiremod/components/atom/health_state.dm | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/wiremod/components/atom/health.dm b/code/modules/wiremod/components/atom/health.dm index ee04030259e..49798930d97 100644 --- a/code/modules/wiremod/components/atom/health.dm +++ b/code/modules/wiremod/components/atom/health.dm @@ -43,7 +43,8 @@ var/mob/living/organism = input_port.value var/turf/current_turf = get_location() - if(!istype(organism) || get_dist(current_turf, organism) > max_range || current_turf.z != organism.z) + var/turf/target_location = get_turf(organism) + if(!istype(organism) || get_dist(current_turf, target_location) > max_range || current_turf.z != target_location.z) brute.set_output(null) burn.set_output(null) toxin.set_output(null) diff --git a/code/modules/wiremod/components/atom/health_state.dm b/code/modules/wiremod/components/atom/health_state.dm index dc83a41fdfd..65031115941 100644 --- a/code/modules/wiremod/components/atom/health_state.dm +++ b/code/modules/wiremod/components/atom/health_state.dm @@ -36,7 +36,8 @@ /obj/item/circuit_component/compare/health_state/do_comparisons() var/mob/living/organism = input_port.value var/turf/current_turf = get_location() - if(!istype(organism) || current_turf.z != organism.z || get_dist(current_turf, organism) > max_range) + var/turf/target_location = get_turf(organism) + if(!istype(organism) || current_turf.z != target_location.z || get_dist(current_turf, target_location) > max_range) return FALSE var/current_option = state_option.value