Skip to content

Commit

Permalink
[MIRROR] Half fixes organ blood dna not updating (#1082)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Feb 21, 2024
1 parent 0e26bb7 commit a08661e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 3 additions & 5 deletions code/modules/forensics/_forensics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 6 additions & 6 deletions code/modules/surgery/organs/organ_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a08661e

Please sign in to comment.