From 5a9d9a95ba5dd5bbf00ae0fff8ac09b590c0f4de Mon Sep 17 00:00:00 2001 From: Zwei <35403274+Gottfrei@users.noreply.github.com> Date: Sun, 22 Oct 2023 09:17:28 +0300 Subject: [PATCH] bugfix: Malf AI Destroy Datum Fix (#3752) --- code/modules/antagonists/malf_ai/malf_ai_datum.dm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/code/modules/antagonists/malf_ai/malf_ai_datum.dm b/code/modules/antagonists/malf_ai/malf_ai_datum.dm index 1250f2b1b38..1a6707e599f 100644 --- a/code/modules/antagonists/malf_ai/malf_ai_datum.dm +++ b/code/modules/antagonists/malf_ai/malf_ai_datum.dm @@ -23,13 +23,14 @@ /datum/antagonist/malf_ai/Destroy(force, ...) - var/mob/living/silicon/ai/malf = owner.current - malf.clear_zeroth_law() - malf.common_radio.channels.Remove("Syndicate") // De-traitored AIs can still state laws over the syndicate channel without this - malf.laws.sorted_laws = malf.laws.inherent_laws.Copy() // AI's 'notify laws' button will still state a law 0 because sorted_laws contains it - malf.show_laws() - malf.remove_malf_abilities() - QDEL_NULL(malf.malf_picker) + var/mob/living/silicon/ai/malf = owner?.current + if(istype(malf)) + malf.clear_zeroth_law() + malf.common_radio.channels.Remove("Syndicate") // De-traitored AIs can still state laws over the syndicate channel without this + malf.laws.sorted_laws = malf.laws.inherent_laws.Copy() // AI's 'notify laws' button will still state a law 0 because sorted_laws contains it + malf.show_laws() + malf.remove_malf_abilities() + QDEL_NULL(malf.malf_picker) return ..()