From a4310b4c7b24b510ee4f6dbe86f45c20e60b2dd0 Mon Sep 17 00:00:00 2001 From: ACCount12 Date: Wed, 25 Oct 2017 23:50:11 +0300 Subject: [PATCH] Fixes a common runtime on prefs screen --- code/modules/surgery/bodyparts/dismemberment.dm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 279589c4b1b..9784dd115cc 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -121,14 +121,22 @@ O.transfer_to_limb(src, C) update_icon_dropped() - forceMove(T) C.update_health_hud() //update the healthdoll C.update_body() C.update_hair() C.update_canmove() + + if(!T) // T = null happens when a "dummy human" used for rendering icons on prefs screen gets its limbs replaced. + qdel(src) + return + if(is_pseudopart) drop_organs(C) //Psuedoparts shouldn't have organs, but just in case qdel(src) + return + + forceMove(T) + //when a limb is dropped, the internal organs are removed from the mob and put into the limb