From 21fdb87774bad537d7db337d71a9a7ba10081a3e Mon Sep 17 00:00:00 2001 From: Doubleumc Date: Sun, 19 May 2024 17:12:04 -0400 Subject: [PATCH] Track targets in interiors (#6305) # About the pull request Squad/Queen/Leader trackers can indicate the direction of the interior the target is in. ![image](https://github.com/cmss13-devs/cmss13/assets/14267245/285565f7-8d0f-4a91-ba46-bf289bea691d) ![image](https://github.com/cmss13-devs/cmss13/assets/14267245/85dd3749-7af6-4136-9b4c-84c76f8f2c9a) # Explain why it's good for the game Even though mechanically the interior is on a different z-level, their contents isn't meant to be a different dimension and the tracker should continue to give helpful information. # Testing Photographs and Procedure
Screenshots & Videos Put screenshots and videos here with an empty line between the screenshots and the `
` tags.
# Changelog :cl: qol: squad/queen/leader trackers can find targets in interiors /:cl: --- code/modules/mob/living/carbon/human/human.dm | 12 ++++++++++-- code/modules/mob/living/carbon/xenomorph/life.dm | 6 ++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1dc1b1e08282..eb19593bde46 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1272,10 +1272,18 @@ if(!H || H.w_uniform?.sensor_mode != SENSOR_MODE_LOCATION) return - if(H.z != src.z || get_dist(src,H) < 1 || src == H) + + var/atom/tracking_atom = H + if(tracking_atom.z != src.z && SSinterior.in_interior(tracking_atom)) + var/datum/interior/interior = SSinterior.get_interior_by_coords(tracking_atom.x, tracking_atom.y, tracking_atom.z) + var/atom/exterior = interior.exterior + if(exterior) + tracking_atom = exterior + + if(tracking_atom.z != src.z || get_dist(src, tracking_atom) < 1 || src == tracking_atom) hud_used.locate_leader.icon_state = "trackondirect[tracking_suffix]" else - hud_used.locate_leader.setDir(Get_Compass_Dir(src,H)) + hud_used.locate_leader.setDir(Get_Compass_Dir(src, tracking_atom)) hud_used.locate_leader.icon_state = "trackon[tracking_suffix]" /mob/living/carbon/proc/locate_nearest_nuke() diff --git a/code/modules/mob/living/carbon/xenomorph/life.dm b/code/modules/mob/living/carbon/xenomorph/life.dm index 15367d9c5d61..1aa83065bf16 100644 --- a/code/modules/mob/living/carbon/xenomorph/life.dm +++ b/code/modules/mob/living/carbon/xenomorph/life.dm @@ -428,6 +428,12 @@ Make sure their actual health updates immediately.*/ queen_locator() return + if(tracking_atom.loc.z != loc.z && SSinterior.in_interior(tracking_atom)) + var/datum/interior/interior = SSinterior.get_interior_by_coords(tracking_atom.x, tracking_atom.y, tracking_atom.z) + var/atom/exterior = interior.exterior + if(exterior) + tracking_atom = exterior + if(tracking_atom.loc.z != loc.z || get_dist(src, tracking_atom) < 1 || src == tracking_atom) locator.icon_state = "trackondirect" else