Prevent constructed AI laws from randomly becoming null. (#25913)

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
This commit is contained in:
Charlie Nolan
2024-06-14 05:06:11 +00:00
committed by GitHub
co-authored by FunnyMan3595
parent 1fae459c26
commit 3bc5f8ebbe
+2
View File
@@ -178,6 +178,8 @@
SSticker.mode.remove_revolutionary(brain.brainmob.mind, 1)
var/mob/living/silicon/ai/A = new /mob/living/silicon/ai(loc, laws, brain)
// Stop holding onto the laws so we don't qdel them and make the AI randomly lose its laws when GC gives up and hard deletes them.
laws = null
if(A) //if there's no brain, the mob is deleted and a structure/AIcore is created
A.rename_self("AI", 1)
SSblackbox.record_feedback("amount", "ais_created", 1)