From ebc9cafc2b31e2a7a86d942d160c23e9df8bdbce Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 3 Dec 2021 12:10:59 +0100 Subject: [PATCH] [MIRROR] Fix AI eye not being recreated if it was qdel'd, but not nulled [MDB IGNORE] (#9850) * Fix AI eye not being recreated if it was qdel'd, but not nulled (#63131) As an error recovery point, if the eye somehow gets qdel'd, it is recreated when you try to move to the core. However, this error recovery doesn't work if the AI eye is qdel'd without being nulled, as create_eye() checks if eyeobj exists (NOT if it's qdel'd). Of course the real bug is in whatever is qdel'ing the eye, but considering this is an existing error recovery system, it should still work! * Fix AI eye not being recreated if it was qdel'd, but not nulled Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> --- code/modules/mob/living/silicon/ai/freelook/eye.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 4c14dee9865..058eb180313 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -188,6 +188,8 @@ if(isturf(loc) && (QDELETED(eyeobj) || !eyeobj.loc)) to_chat(src, "ERROR: Eyeobj not found. Creating new eye...") + stack_trace("AI eye object wasn't found! Location: [loc] / Eyeobj: [eyeobj] / QDELETED: [QDELETED(eyeobj)] / Eye loc: [eyeobj?.loc]") + QDEL_NULL(eyeobj) create_eye() eyeobj?.setLoc(loc)