From 6cfcc40e66b2d02eec934f8d4c57df631d957b9d Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Thu, 11 Oct 2018 07:07:19 -0400 Subject: [PATCH] Fixes admin revives not restoring mutant organs --- .../carbon/human/species_types/mothmen.dm | 5 +- code/modules/surgery/organs/organ_internal.dm | 85 +++++-------------- 2 files changed, 21 insertions(+), 69 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index d15d9893849..6272b080308 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -16,12 +16,11 @@ toxic_food = MEAT | RAW mutanteyes = /obj/item/organ/eyes/moth -/datum/species/moth/on_species_gain(mob/living/carbon/C) +/datum/species/moth/regenerate_organs(mob/living/carbon/C,datum/species/old_species,replace_current=TRUE) . = ..() if(ishuman(C)) var/mob/living/carbon/human/H = C - if(!H.dna.features["moth_wings"]) - H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]" + H.dna.features["moth_wings"] = "[(H.client && H.client.prefs && LAZYLEN(H.client.prefs.features) && H.client.prefs.features["moth_wings"]) ? H.client.prefs.features["moth_wings"] : "Plain"]" handle_mutant_bodyparts(H) /datum/species/moth/random_name(gender,unique,lastname) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 1408bff60cf..cc64809a91e 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -107,74 +107,27 @@ return 0 /mob/living/carbon/regenerate_organs() - var/breathes = TRUE - var/blooded = TRUE - if(dna && dna.species) - if(has_trait(TRAIT_NOBREATH, SPECIES_TRAIT)) - breathes = FALSE - if(NOBLOOD in dna.species.species_traits) - blooded = FALSE - var/has_liver = (!(NOLIVER in dna.species.species_traits)) - var/has_stomach = (!(NOSTOMACH in dna.species.species_traits)) + if(dna?.species) + dna.species.regenerate_organs(src) + return - if(has_liver && !getorganslot(ORGAN_SLOT_LIVER)) - var/obj/item/organ/liver/LI + else + if(!getorganslot(ORGAN_SLOT_LUNGS)) + var/obj/item/organ/lungs/L = new() + L.Insert(src) - if(dna.species.mutantliver) - LI = new dna.species.mutantliver() - else - LI = new() - LI.Insert(src) + if(!getorganslot(ORGAN_SLOT_HEART)) + var/obj/item/organ/heart/H = new() + H.Insert(src) - if(has_stomach && !getorganslot(ORGAN_SLOT_STOMACH)) - var/obj/item/organ/stomach/S + if(!getorganslot(ORGAN_SLOT_TONGUE)) + var/obj/item/organ/tongue/T = new() + T.Insert(src) - if(dna.species.mutantstomach) - S = new dna.species.mutantstomach() - else - S = new() - S.Insert(src) + if(!getorganslot(ORGAN_SLOT_EYES)) + var/obj/item/organ/eyes/E = new() + E.Insert(src) - if(breathes && !getorganslot(ORGAN_SLOT_LUNGS)) - var/obj/item/organ/lungs/L = new() - L.Insert(src) - - if(blooded && !getorganslot(ORGAN_SLOT_HEART)) - var/obj/item/organ/heart/H = new() - H.Insert(src) - - if(!getorganslot(ORGAN_SLOT_TONGUE)) - var/obj/item/organ/tongue/T - - if(dna && dna.species && dna.species.mutanttongue) - T = new dna.species.mutanttongue() - else - T = new() - - // if they have no mutant tongues, give them a regular one - T.Insert(src) - - if(!getorganslot(ORGAN_SLOT_EYES)) - var/obj/item/organ/eyes/E - - if(dna && dna.species && dna.species.mutanteyes) - E = new dna.species.mutanteyes() - - else - E = new() - E.Insert(src) - - if(!getorganslot(ORGAN_SLOT_EARS)) - var/obj/item/organ/ears/ears - if(dna && dna.species && dna.species.mutantears) - ears = new dna.species.mutantears - else - ears = new - - ears.Insert(src) - - if(!getorganslot(ORGAN_SLOT_TAIL)) - var/obj/item/organ/tail/tail - if(dna && dna.species && dna.species.mutanttail) - tail = new dna.species.mutanttail - tail.Insert(src) + if(!getorganslot(ORGAN_SLOT_EARS)) + var/obj/item/organ/ears/ears = new() + ears.Insert(src)