From a08661ee2d505ae10d95e7a5a87c251a3608c253 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Tue, 20 Feb 2024 23:18:40 -0500 Subject: [PATCH] [MIRROR] Half fixes organ blood dna not updating (#1082) * Half fixes organ blood dna not updating (#81584) ## About The Pull Request Organs have this mechanic where they store the first mob who owned it's DNA Anyways it was broken from the organ nullspace refactor because they intended a block of code that shouldn't have been indented But this only *half* fixes the issue, you see a problem here? ![image](https://github.com/tgstation/tgstation/assets/51863163/886dd926-3242-4305-825b-a715d6848281) Yeah there's an order of operation thing going on here because you get your organs before you get your species bloodtype This only affects species with weird blood types (like lizards) I'm not fixing it in this PR because it was certainly broken before and needs a bit more unwinding somewhere ## Changelog :cl: Melbert fix: Organs have the blood DNA of their owns on them again /:cl: * Half fixes organ blood dna not updating --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/_globalvars/bitfields.dm | 2 ++ code/modules/forensics/_forensics.dm | 8 +++----- code/modules/surgery/organs/organ_movement.dm | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm index ba2177ef64c..a6a888e07b9 100644 --- a/code/_globalvars/bitfields.dm +++ b/code/_globalvars/bitfields.dm @@ -458,6 +458,8 @@ DEFINE_BITFIELD(organ_flags, list( "ORGAN_VITAL" = ORGAN_VITAL, "ORGAN_EDIBLE" = ORGAN_EDIBLE, "ORGAN_UNREMOVABLE" = ORGAN_UNREMOVABLE, + "ORGAN_HIDDEN" = ORGAN_HIDDEN, + "ORGAN_VIRGIN" = ORGAN_VIRGIN, )) DEFINE_BITFIELD(respiration_type, list( diff --git a/code/modules/forensics/_forensics.dm b/code/modules/forensics/_forensics.dm index 75cbc55df28..6a06e549d26 100644 --- a/code/modules/forensics/_forensics.dm +++ b/code/modules/forensics/_forensics.dm @@ -230,11 +230,9 @@ /// Updates the blood displayed on parent /datum/forensics/proc/check_blood() - if(!parent || !isitem(parent.resolve())) - return - if(isorgan(parent.resolve())) // organs don't spawn with blood decals by default + var/obj/item/the_thing = parent.resolve() + if(!istype(the_thing) || isorgan(the_thing)) // organs don't spawn with blood decals by default return if(!length(blood_DNA)) return - var/atom/parent_atom = parent.resolve() - parent_atom.AddElement(/datum/element/decal/blood) + the_thing.AddElement(/datum/element/decal/blood) diff --git a/code/modules/surgery/organs/organ_movement.dm b/code/modules/surgery/organs/organ_movement.dm index bee717fb764..101bbc46c71 100644 --- a/code/modules/surgery/organs/organ_movement.dm +++ b/code/modules/surgery/organs/organ_movement.dm @@ -58,12 +58,12 @@ else replaced.forceMove(get_turf(receiver)) - if(!IS_ROBOTIC_ORGAN(src) && (organ_flags & ORGAN_VIRGIN)) - blood_dna_info = receiver.get_blood_dna_list() - // need to remove the synethic blood DNA that is initialized - // wash also adds the blood dna again - wash(CLEAN_TYPE_BLOOD) - organ_flags &= ~ORGAN_VIRGIN + if(!IS_ROBOTIC_ORGAN(src) && (organ_flags & ORGAN_VIRGIN)) + blood_dna_info = receiver.get_blood_dna_list() + // need to remove the synethic blood DNA that is initialized + // wash also adds the blood dna again + wash(CLEAN_TYPE_BLOOD) + organ_flags &= ~ORGAN_VIRGIN receiver.organs |= src receiver.organs_slot[slot] = src