diff --git a/code/modules/resleeving/infocore_records.dm b/code/modules/resleeving/infocore_records.dm index c66e63b7d97..8461d8bfe34 100644 --- a/code/modules/resleeving/infocore_records.dm +++ b/code/modules/resleeving/infocore_records.dm @@ -204,6 +204,41 @@ if(add_to_db) SStranscore.add_body(src, database_key = database_key) +/** + * Make a deep copy of this record so it can be saved on a disk without modifications + * to the original affecting the copy. + * Just to be clear, this has nothing to do do with acutal biological cloning, body printing, resleeving, + * or anything like that! This is the computer science concept of "cloning" a data structure! + */ +/datum/transhuman/body_record/proc/init_from_br(var/datum/transhuman/body_record/orig) + ASSERT(!QDELETED(orig)) + ASSERT(istype(orig)) + src.mydna = new () + qdel_swap(src.mydna.dna, orig.mydna.dna.Clone()) + src.mydna.ckey = orig.mydna.ckey + src.mydna.id = orig.mydna.id + src.mydna.name = orig.mydna.name + src.mydna.types = orig.mydna.types + src.mydna.flavor = orig.mydna.flavor.Copy() + src.ckey = orig.ckey + src.locked = orig.locked + src.client_ref = orig.client_ref + src.mind_ref = orig.mind_ref + src.synthetic = orig.synthetic + src.speciesname = orig.speciesname + src.bodygender = orig.bodygender + src.body_oocnotes = orig.body_oocnotes + src.body_ooclikes = orig.body_ooclikes + src.body_oocdislikes = orig.body_oocdislikes + src.limb_data = orig.limb_data.Copy() + src.organ_data = orig.organ_data.Copy() + src.genetic_modifiers = orig.genetic_modifiers.Copy() + src.toocomplex = orig.toocomplex + src.sizemult = orig.sizemult + src.aflags = orig.aflags + src.breath_type = orig.breath_type + src.weight = orig.weight + /** * Spawning a body was once left entirely up to the machine doing it, but bodies are massivley complex * objects, and doing it this way lead to huge amounts of copypasted code to do the same thing. @@ -319,38 +354,3 @@ H.weight = weight if(speciesname) H.custom_species = speciesname - -/** - * Make a deep copy of this record so it can be saved on a disk without modifications - * to the original affecting the copy. - * Just to be clear, this has nothing to do do with acutal biological cloning, body printing, resleeving, - * or anything like that! This is the computer science concept of "cloning" a data structure! - */ -/datum/transhuman/body_record/proc/init_from_br(var/datum/transhuman/body_record/orig) - ASSERT(!QDELETED(orig)) - ASSERT(istype(orig)) - src.mydna = new () - qdel_swap(src.mydna.dna, orig.mydna.dna.Clone()) - src.mydna.ckey = orig.mydna.ckey - src.mydna.id = orig.mydna.id - src.mydna.name = orig.mydna.name - src.mydna.types = orig.mydna.types - src.mydna.flavor = orig.mydna.flavor.Copy() - src.ckey = orig.ckey - src.locked = orig.locked - src.client_ref = orig.client_ref - src.mind_ref = orig.mind_ref - src.synthetic = orig.synthetic - src.speciesname = orig.speciesname - src.bodygender = orig.bodygender - src.body_oocnotes = orig.body_oocnotes - src.body_ooclikes = orig.body_ooclikes - src.body_oocdislikes = orig.body_oocdislikes - src.limb_data = orig.limb_data.Copy() - src.organ_data = orig.organ_data.Copy() - src.genetic_modifiers = orig.genetic_modifiers.Copy() - src.toocomplex = orig.toocomplex - src.sizemult = orig.sizemult - src.aflags = orig.aflags - src.breath_type = orig.breath_type - src.weight = orig.weight diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index 31d6e7a4a77..8b539e2d6d6 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -29,25 +29,25 @@ remove_biomass(CLONE_BIOMASS) //Get the DNA and generate a new mob - var/datum/dna2/record/R = current_project.mydna - occupant = R.produce_human_mob(FALSE,FALSE,"clone ([rand(0,999)])") + var/mob/living/carbon/human/H = current_project.produce_human_mob(FALSE,FALSE,"clone ([rand(0,999)])") //Give breathing equipment if needed - if(breath_type != null && breath_type != GAS_O2) - occupant.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(occupant), slot_wear_mask) + if(current_project.breath_type != null && current_project.breath_type != GAS_O2) + H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask) var/obj/item/tank/tankpath - if(breath_type == GAS_PHORON) + if(current_project.breath_type == GAS_PHORON) tankpath = /obj/item/tank/vox else - tankpath = text2path("/obj/item/tank/" + breath_type) + tankpath = text2path("/obj/item/tank/" + current_project.breath_type) if(tankpath) - occupant.equip_to_slot_or_del(new tankpath(occupant), slot_back) - occupant.internal = occupant.back - if(istype(occupant.internal,/obj/item/tank) && occupant.internals) - occupant.internals.icon_state = "internal1" + H.equip_to_slot_or_del(new tankpath(H), slot_back) + H.internal = H.back + if(istype(H.internal,/obj/item/tank) && H.internals) + H.internals.icon_state = "internal1" //Apply damage + occupant = H occupant.adjustCloneLoss((occupant.getMaxHealth() - (occupant.getMaxHealth()))*-0.75) occupant.Paralyse(4) occupant.updatehealth()