[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>
This commit is contained in:
SkyratBot
2021-12-03 12:10:59 +01:00
committed by GitHub
parent d70efd71dc
commit ebc9cafc2b
@@ -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)