From 737b4e49c1cc4cef739452573fef470ab487aa44 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 23 Dec 2020 06:28:15 +0100 Subject: [PATCH] [MIRROR] DNA comparison fix (#2284) * DNA fix (#55669) This PR fixes a problem where DNA proc "is_same_as" always returned FALSE because of bad assoc list comparison. The use of the proc mentioned above is very limited, and only practical effect will be that changelings cannot extract DNA they already have stored, which is intended limitation as per can_absorb_dna proc in the changeling antagonist datum. * DNA comparison fix Co-authored-by: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> --- code/datums/dna.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index a034cf2c58c..b554b4141e6 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -231,9 +231,15 @@ update_instability(FALSE) return -/datum/dna/proc/is_same_as(datum/dna/D) - if(uni_identity == D.uni_identity && mutation_index == D.mutation_index && real_name == D.real_name) - if(species.type == D.species.type && features == D.features && blood_type == D.blood_type) +/** + * Checks if two DNAs are practically the same by comparing their most defining features + * + * Arguments: + * * target_dna The DNA that we are comparing to + */ +/datum/dna/proc/is_same_as(datum/dna/target_dna) + if(uni_identity == target_dna.uni_identity && mutation_index == target_dna.mutation_index && real_name == target_dna.real_name) + if(species.type == target_dna.species.type && compare_list(features, target_dna.features) && blood_type == target_dna.blood_type) return TRUE return FALSE