From 4f9440ecda8199c36d35de8983ed8ee2a5d33759 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Mon, 13 Feb 2023 01:45:34 +0100
Subject: [PATCH] [MIRROR] Fixes Admin Make AI not working on observers [MDB
IGNORE] (#19307)
* Fixes Admin Make AI not working on observers (#73353)
## About The Pull Request
Using player panel `make ai` on an observer no longer fails to insert
the player into the created AI.
`ai/Initialize()` does a mind transfer, but observers don't have minds.
Fixes this by moving over any present keys if the player is mindless.
## Why It's Good For The Game
Helps in testing
## Changelog
:cl: Melbert
fix: Fixes player panel "make ai" button not fully working on observers
/:cl:
* Fixes Admin Make AI not working on observers
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
---
code/modules/mob/living/silicon/ai/ai.dm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 27a684bad33..a5f3bfc21ef 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -140,6 +140,8 @@
to_chat(src, span_danger("You must obey your silicon laws above all else. Your objectives will consider you to be dead."))
if(!mind.has_ever_been_ai)
mind.has_ever_been_ai = TRUE
+ else if(target_ai.key)
+ key = target_ai.key
to_chat(src, "You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).")
to_chat(src, "To look at other parts of the station, click on yourself to get a camera menu.")