Fixes AI laws being eaten by the garbage collector in certain conditions (#55984)

Extra AIs created by players will no longer lose their laws shortly after they are created.
This commit is contained in:
zxaber
2021-01-07 04:36:57 -08:00
committed by GitHub
parent 87a5feb53e
commit e016ea8a02
+2
View File
@@ -237,8 +237,10 @@
if (brain.overrides_aicore_laws)
A = new /mob/living/silicon/ai(loc, brain.laws, B)
brain.laws = null //Brain's law datum is being donated, so we need the brain to let it go or the GC will eat it
else
A = new /mob/living/silicon/ai(loc, laws, B)
laws = null //we're giving the new AI this datum, so let's not delete it when we qdel(src) 5 lines from now
if(brain.force_replace_ai_name)
A.fully_replace_character_name(A.name, brain.replacement_ai_name())