From 02d6e7a303e8d7203f4228b3acbf11086ab53dc7 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 5 Jun 2015 12:49:48 +0300 Subject: [PATCH 1/2] Fixes #9605 Now organ DNA is sync'd to newly created character. --- code/modules/mob/living/carbon/human/human.dm | 2 ++ code/modules/mob/living/carbon/human/human_organs.dm | 7 ++++++- code/modules/mob/new_player/new_player.dm | 2 +- code/modules/organs/organ.dm | 6 ++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 10e165fa5f..9273c3372a 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -41,7 +41,9 @@ ..() if(dna) + dna.ready_dna(new_character) dna.real_name = real_name + sync_organ_dna() make_blood() /mob/living/carbon/human/Destroy() diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index f2c64fa52a..2dec075afa 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -171,4 +171,9 @@ //New are added for reagents to random organs. for(var/datum/reagent/A in reagents.reagent_list) var/obj/item/organ/O = pick(organs) - O.trace_chemicals[A.name] = 100 \ No newline at end of file + O.trace_chemicals[A.name] = 100 + +/mob/living/carbon/human/proc/sync_organ_dna() + var/list/all_bits = internal_organs|organs + for(var/obj/item/organ/O in all_bits) + O.set_dna(dna) \ No newline at end of file diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 1e18882137..8bd0be34bc 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -467,7 +467,7 @@ new_character.name = real_name new_character.dna.ready_dna(new_character) new_character.dna.b_type = client.prefs.b_type - + new_character.sync_organ_dna() if(client.prefs.disabilities) // Set defer to 1 if you add more crap here so it only recalculates struc_enzymes once. - N3X new_character.dna.SetSEState(GLASSESBLOCK,1,0) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 038a350fb5..7afe7293dd 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -57,6 +57,12 @@ var/list/organ_cache = list() if(internal) holder.internal_organs |= src +/obj/item/organ/proc/set_dna(var/datum/dna/new_dna) + if(new_dna) + dna = new_dna.Clone() + blood_DNA.Cut() + blood_DNA[dna.unique_enzymes] = dna.b_type + /obj/item/organ/proc/die() if(status & ORGAN_ROBOT) return From 364c2dc01a7aca1625c1367944681623a8aa47c5 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 5 Jun 2015 13:18:27 +0300 Subject: [PATCH 2/2] Fixes typo. --- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/organs/organ_external.dm | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9273c3372a..120067144f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -41,7 +41,7 @@ ..() if(dna) - dna.ready_dna(new_character) + dna.ready_dna(src) dna.real_name = real_name sync_organ_dna() make_blood() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b7541153a5..3ff375faa1 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -613,7 +613,7 @@ Note that amputating the affected organ does in fact remove the infection from t //things tend to bleed if they are CUT OPEN if (open && !clamped && (H && !(H.species.flags & NO_BLOOD))) status |= ORGAN_BLEEDING - + //Bone fractures if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) src.fracture() @@ -908,7 +908,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/proc/is_usable() if((status & ORGAN_ROBOT) && get_damage() >= max_damage) //robot limbs just become inoperable at max damage - return + return return !is_dislocated() && !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning() @@ -1051,6 +1051,7 @@ Note that amputating the affected organ does in fact remove the infection from t if(6 to INFINITY) flavor_text += "a ton of [wound]\s" return english_list(flavor_text) + /**************************************************** ORGAN DEFINES ****************************************************/