From 5fda487e430d1e358fec1eea7364d9c033006db9 Mon Sep 17 00:00:00 2001 From: ARGUS <268038739+ARGUS-Memory@users.noreply.github.com> Date: Fri, 20 Mar 2026 00:32:37 +0100 Subject: [PATCH] fix: update_dna no longer resets SE blocks, fixing morph gene wipe bug (#19291) update_dna() was calling dna.ready_dna() which internally calls ResetSE(), setting all SE blocks to rand(1,1024) (the OFF range). Any subsequent domutcheck(MUTCHK_FORCED) call would then deactivate every trait gene because all SE values read as inactive, including the morph gene itself. Replace dna.ready_dna(src) with dna.ResetUIFrom(src), which re-encodes appearance DNA from the mob's current state without touching the SE layer. Also correct the stale sync_organ_dna(dna) call to the correct no-argument form matching the proc signature. Affected call sites that triggered this bug: the morph appearance editor, change_gender, add_marking, remove_marking, change_priority_of_marking, and change_marking_color. Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/modules/mob/living/carbon/human/appearance.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index f4b7de4043..92ac922b4b 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -171,8 +171,8 @@ /mob/living/carbon/human/proc/update_dna() check_dna() - dna.ready_dna(src) - sync_organ_dna(dna) + dna.ResetUIFrom(src) // Do not call ready_dna here: it resets ALL SE blocks, wiping trait gene state + sync_organ_dna() /mob/living/carbon/human/proc/generate_valid_species(var/check_whitelist = 1, var/list/whitelist = list(), var/list/blacklist = list()) var/list/valid_species = new()