diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 4a4917ddf8f..4b2dcd59325 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -51,6 +51,33 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) /obj/item/organ/Initialize(mapload, internal) . = ..() + var/mob/living/carbon/holder = loc + create_reagents(5) + if(!max_damage) + max_damage = min_broken_damage * 2 + if(istype(holder)) + src.owner = holder + species = GLOB.all_species[SPECIES_HUMAN] + if(holder.dna) + dna = holder.dna.Clone() + species = GLOB.all_species[dna.species] + else + LOG_DEBUG("[src] at [loc] spawned without a proper DNA.") + var/mob/living/carbon/human/H = holder + if(istype(H)) + if(internal) + var/obj/item/organ/external/E = H.get_organ(parent_organ) + if(E) + if(E.internal_organs == null) + E.internal_organs = list() + E.internal_organs |= src + if(dna) + if(!blood_DNA) + blood_DNA = list() + blood_DNA[dna.unique_enzymes] = dna.b_type + if(internal) + holder.internal_organs |= src + START_PROCESSING(SSprocessing, src) /obj/item/organ/Destroy() @@ -83,36 +110,6 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) /obj/item/organ/proc/update_health() return -/obj/item/organ/Initialize(mapload, internal) - . = ..() - var/mob/living/carbon/holder = loc - create_reagents(5) - if(!max_damage) - max_damage = min_broken_damage * 2 - if(istype(holder)) - src.owner = holder - species = GLOB.all_species[SPECIES_HUMAN] - if(holder.dna) - dna = holder.dna.Clone() - species = GLOB.all_species[dna.species] - else - LOG_DEBUG("[src] at [loc] spawned without a proper DNA.") - var/mob/living/carbon/human/H = holder - if(istype(H)) - if(internal) - var/obj/item/organ/external/E = H.get_organ(parent_organ) - if(E) - if(E.internal_organs == null) - E.internal_organs = list() - E.internal_organs |= src - if(dna) - if(!blood_DNA) - blood_DNA = list() - blood_DNA[dna.unique_enzymes] = dna.b_type - if(internal) - holder.internal_organs |= src - START_PROCESSING(SSprocessing, src) - /obj/item/organ/proc/set_dna(var/datum/dna/new_dna) if(new_dna) dna = new_dna.Clone() diff --git a/html/changelogs/FluffyGhost-unifiedorganinitialize.yml b/html/changelogs/FluffyGhost-unifiedorganinitialize.yml new file mode 100644 index 00000000000..1ff65af0c8a --- /dev/null +++ b/html/changelogs/FluffyGhost-unifiedorganinitialize.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - refactor: "Unified /organ Initialize() in a single proc."