From 00b0a84d3c1b5ce8ed2ba026d183ba08628d1f09 Mon Sep 17 00:00:00 2001 From: DeityLink Date: Mon, 17 Jul 2023 17:49:37 +0200 Subject: [PATCH] Fixes AIs using their Station Holomap on other Z Levels (#34684) --- code/game/machinery/station_map.dm | 6 +++++- code/modules/mob/living/silicon/ai/freelook/eye.dm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/station_map.dm b/code/game/machinery/station_map.dm index dfa30e18501..e5a0aebc025 100644 --- a/code/game/machinery/station_map.dm +++ b/code/game/machinery/station_map.dm @@ -324,6 +324,8 @@ var/list/station_holomaps = list() if(user.hud_used && user.hud_used.holomap_obj) watching_mob = user var/turf/T = get_turf(user) + if (isAI) + T = get_turf(watching_mob.client.eye) bogus = 0 if(!((HOLOMAP_EXTRA_STATIONMAP+"_[T.z]") in extraMiniMaps)) bogus = 1 @@ -345,12 +347,14 @@ var/list/station_holomaps = list() else to_chat(user, "A hologram of the station appears before your eyes.") -/obj/item/device/station_map/proc/update_holomap() +/obj/item/device/station_map/proc/update_holomap(var/isAI = FALSE) if (!watching_mob || !watching_mob.client || !watching_mob.hud_used) return watching_mob.client.images -= holomap_datum.station_map holomap_datum.station_map.overlays.len = 0 var/turf/T = get_turf(src) + if (isAI) + T = get_turf(watching_mob.client.eye) if (lastZ != T.z) lastZ = T.z bogus = 0 diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index f64c8c4c864..72146318e93 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -56,7 +56,7 @@ ai.light_cameras() if (ai.station_holomap) - ai.station_holomap.update_holomap() + ai.station_holomap.update_holomap(TRUE) /mob/camera/aiEye/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0, glide_size_override = 0) return 0