From 575c8f53a25bfcacc9f1c9af1faeb2a5f98a90bf Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Wed, 1 May 2024 15:39:59 +0000 Subject: [PATCH] Fixes cyborg tracking not always showing up (#82975) ## About The Pull Request Silicons moving with their builtincamera doesnt automatically update the camera net, so for some time after borgs move, they wont show up to the AI to track. It's a minor but annoying issue that this fixes. ## Why It's Good For The Game Fixes a minor issue with the new ai tracking stuff. ## Changelog :cl: fix: AIs can now track Silicon as long as their built-in camera is online. /:cl: --- code/modules/mob/living/living.dm | 4 ++-- code/modules/mob/living/silicon/silicon.dm | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index d77d7409561..5f5889ae0a3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1290,9 +1290,9 @@ return FALSE if(invisibility || alpha <= 50)//cloaked return FALSE - if(!isturf(src.loc)) //The reason why we don't just use get_turf is because they could be in a closet, disposals, or a vehicle. + if(!isturf(loc)) //The reason why we don't just use get_turf is because they could be in a closet, disposals, or a vehicle. return FALSE - var/turf/T = src.loc + var/turf/T = loc if(is_centcom_level(T.z)) //dont detect mobs on centcom return FALSE if(is_away_level(T.z)) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 5c47c4e5bb8..95e2e6ed133 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -480,3 +480,11 @@ stack_trace("Silicon [src] ( [type] ) was somehow missing their integrated tablet. Please make a bug report.") create_modularInterface() modularInterface.imprint_id(name = newname) + +/mob/living/silicon/can_track(mob/living/user) + //if their camera is online, it's safe to assume they are in cameranets + //since it takes a while for camera vis to update, this lets us bypass that so AIs can always see their borgs, + //without making cameras constantly update every time a borg moves. + if(builtInCamera && builtInCamera.can_use()) + return TRUE + return ..()