From 4576d03eb46ee579f6c0d6aa4ccb9861335153d9 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 28 May 2017 17:27:25 -0500 Subject: [PATCH] Fixes attaching heads without brainmobs (#1273) --- code/modules/surgery/bodyparts/dismemberment.dm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 585f452de4..089d8be105 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -294,10 +294,11 @@ /obj/item/bodypart/head/attach_limb(mob/living/carbon/C, special) //Transfer some head appearance vars over if(brain) - brainmob.container = null //Reset brainmob head var. - brainmob.loc = brain //Throw mob into brain. - brain.brainmob = brainmob //Set the brain to use the brainmob - brainmob = null //Set head brainmob var to null + if(brainmob) + brainmob.container = null //Reset brainmob head var. + brainmob.loc = brain //Throw mob into brain. + brain.brainmob = brainmob //Set the brain to use the brainmob + brainmob = null //Set head brainmob var to null brain.Insert(C) //Now insert the brain proper brain = null //No more brain in the head