From 76878341e02cd186b2d29ab7a58a6e951d6cd35a Mon Sep 17 00:00:00 2001 From: Roxy <75404941+TealSeer@users.noreply.github.com> Date: Wed, 26 Feb 2025 21:29:43 -0500 Subject: [PATCH] Fix SAD not transferring wounds (#3167) ## About The Pull Request Add code to `/datum/component/damage_tracker/human` to keep track of wounds and reapply them as needed. ## Why It's Good For The Game Fixes #3162 ## Proof Of Testing I tested with both the permanent limp quirk and breaking one of my arms with force and both wounds stayed after using the SAD ## Changelog :cl: fix: fixed the SAD deleting wounds /:cl: --- .../code/datums/components/damage_tracker.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modular_skyrat/master_files/code/datums/components/damage_tracker.dm b/modular_skyrat/master_files/code/datums/components/damage_tracker.dm index f35cc531f9a..83dade56eda 100644 --- a/modular_skyrat/master_files/code/datums/components/damage_tracker.dm +++ b/modular_skyrat/master_files/code/datums/components/damage_tracker.dm @@ -76,6 +76,9 @@ /// What brain traumas does the owner currently have? var/list/trauma_list = list() + /// What wounds does the owner currently have? + var/list/wound_list = list() + /datum/component/damage_tracker/human/update_damage_values() . = ..() var/mob/living/carbon/human/human_parent = parent @@ -86,6 +89,12 @@ if(length(current_trauma_list)) trauma_list = current_trauma_list.Copy() + for(var/obj/item/bodypart/limb as anything in human_parent.get_wounded_bodyparts()) + for(var/datum/wound/limb_wound as anything in limb.wounds) + if(!islist(wound_list[limb.type])) + wound_list[limb.type] = list() + wound_list[limb.type] |= limb_wound.type + heart_damage = human_parent.check_organ_damage(/obj/item/organ/internal/heart) liver_damage = human_parent.check_organ_damage(/obj/item/organ/internal/liver) lung_damage = human_parent.check_organ_damage(/obj/item/organ/internal/lungs) @@ -121,6 +130,14 @@ human_brain.gain_trauma(trauma_to_add) + for(var/obj/item/bodypart/limb_type as anything in wound_list) + var/obj/item/bodypart/limb_instance = locate(limb_type) in human_parent.bodyparts + if(!limb_instance) + continue + for(var/datum/wound/wound_type as anything in wound_list[limb_type]) + var/datum/wound/new_wound = new wound_type() + new_wound.apply_wound(limb_instance, TRUE) + return TRUE /datum/component/damage_tracker/human/Initialize(...)