From 59021cf6fcf40712f6c74e4c3276992c7ff80fae Mon Sep 17 00:00:00 2001 From: ascio <81930475+asciodev@users.noreply.github.com> Date: Sat, 18 Jan 2025 07:46:48 -0500 Subject: [PATCH] Fixes #28022: mecha/AI/hologram bugs from #25078 PR #25078 introduced a few bugs related to AI eyes, mechs, and holograms. This change fixes those bugs. Now, entering a mech with an active hologram eye will first release that eye before granting control of the mech. Double clicking on a turf as an AI while in a mech will no longer unstick the camera from the mech. When exiting a mech, the AI will now properly refocus on its core instead of on the spot that it first entered the mech. AI holograms no longer receive normal audio near their holopads, receiving only holopad-relayed speech now instead. AIs will no longer be able to activate a holopad while occupying a mech. --- code/_onclick/ai_onclick.dm | 1 + code/game/machinery/hologram.dm | 2 ++ code/game/mecha/mecha.dm | 5 +++++ code/modules/mob/camera/eye/hologram_eye.dm | 1 - 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/_onclick/ai_onclick.dm b/code/_onclick/ai_onclick.dm index a9d63f51c6bb..907522ecc896 100644 --- a/code/_onclick/ai_onclick.dm +++ b/code/_onclick/ai_onclick.dm @@ -16,6 +16,7 @@ return if(control_disabled || stat) return + if(ismecha(loc)) return if(ismob(A)) ai_actual_track(A, TRUE) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 118340d2df83..4bb550e59afa 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -316,6 +316,8 @@ GLOBAL_LIST_EMPTY(holopads) return if(istype(robot)) interact(robot) + if(ismecha(ai.loc)) // AIs must exit mechs before activating holopads. + return /*There are pretty much only three ways to interact here. I don't need to check for client since they're clicking on an object. This may change in the future but for now will suffice.*/ diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index df4cad6e0014..b89c9d04f47e 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -1031,6 +1031,10 @@ //Hack and From Card interactions share some code, so leave that here for both to use. /obj/mecha/proc/ai_enter_mech(mob/living/silicon/ai/AI, interaction) + var/mob/camera/eye/hologram/hologram_eye = AI.remote_control + if(istype(hologram_eye)) + hologram_eye.release_control() + qdel(hologram_eye) AI.aiRestorePowerRoutine = 0 AI.forceMove(src) occupant = AI @@ -1315,6 +1319,7 @@ RemoveActions(occupant, 1) mob_container = AI newloc = get_turf(AI.linked_core) + AI.eyeobj?.set_loc(newloc) qdel(AI.linked_core) else return diff --git a/code/modules/mob/camera/eye/hologram_eye.dm b/code/modules/mob/camera/eye/hologram_eye.dm index a30c63827a9d..9eb9d1f43524 100644 --- a/code/modules/mob/camera/eye/hologram_eye.dm +++ b/code/modules/mob/camera/eye/hologram_eye.dm @@ -2,7 +2,6 @@ name = "Inactive Hologram Eye" ai_detector_visible = FALSE acceleration = FALSE - relay_speech = TRUE var/obj/machinery/hologram/holopad/holopad /mob/camera/eye/hologram/Initialize(mapload, owner_name, camera_origin, mob/living/user)