From 3f602025efcfd30f7fa7cbcf95ae656d8237024c Mon Sep 17 00:00:00 2001 From: QualityVan Date: Thu, 27 Apr 2017 10:25:45 -0400 Subject: [PATCH] Fixes being unable to empty an emagged cloning pod via manual ejection. (#26373) * Fixes being unable to empty an emag'd cloning pod via manual ejection. * No longer keeps the brain, prevents people from getting back into a body which doesn't exist any more, lets people suffer in an emagged cloner a little longer * Better prevention of re-entering body --- code/game/machinery/cloning.dm | 8 +++++--- code/modules/mob/living/carbon/death.dm | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 175fccac77d..2eb3f18af81 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -314,7 +314,7 @@ return else connected_message("Authorized Ejection") - SPEAK("An authorized ejection of [occupant.real_name] has occurred.") + SPEAK("An authorized ejection of [clonemind.name] has occurred.") to_chat(user, "You force an emergency ejection. ") go_out() else @@ -367,6 +367,8 @@ SPEAK("Critical error! Please contact a Thinktronic Systems \ technician, as your warranty may be affected.") mess = TRUE + for(var/obj/item/O in unattached_flesh) + qdel(O) icon_state = "pod_g" if(occupant.mind != clonemind) clonemind.transfer_to(occupant) @@ -382,9 +384,9 @@ go_out() /obj/machinery/clonepod/emp_act(severity) - if(prob(100/(severity*efficiency))) + if((occupant || mess) && prob(100/(severity*efficiency))) connected_message(Gibberish("EMP-caused Accidental Ejection", 0)) - SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [occupant.real_name] prematurely." ,0)) + SPEAK(Gibberish("Exposure to electromagnetic fields has caused the ejection of [clonemind.name] prematurely." ,0)) go_out() ..() diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 59c04c9841f..c6c7196755c 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -24,7 +24,8 @@ if(!no_bodyparts) if(no_organs)//so the organs don't get transfered inside the bodyparts we'll drop. for(var/X in internal_organs) - qdel(X) + if(no_brain || !istype(X, /obj/item/organ/brain)) + qdel(X) else //we're going to drop all bodyparts except chest, so the only organs that needs spilling are those inside it. for(var/X in internal_organs) var/obj/item/organ/O = X @@ -42,6 +43,9 @@ if(no_brain && istype(I, /obj/item/organ/brain)) qdel(I) continue + if(no_organs && !istype(I, /obj/item/organ/brain)) + qdel(I) + continue I.Remove(src) I.forceMove(get_turf(src)) I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5)