From d3fdea4b9914fecb84770f04483c51b289a81f0f Mon Sep 17 00:00:00 2001 From: FenodyreeAv Date: Sat, 11 Apr 2026 13:03:52 +0100 Subject: [PATCH] Fixes the healthdoll not showing robot limbs, or updating when pain goes away. (#22190) Adds some signals to update the HUD when necessary. The only one which will fire every tick is in remove_pain, which will now only fire if there is pain to remove. The extra update in robotize is necessary because robotize is called after Initialize, so robot limbs were being set to the wrong colour. Fixes: #22186 --- .../mob/living/carbon/human/human_damage.dm | 5 +- code/modules/organs/organ_external.dm | 5 +- html/changelogs/Fenodyree-HealthDollFix.yml | 59 +++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 html/changelogs/Fenodyree-HealthDollFix.yml diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 62875c813b9..cbfa35a8fa3 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -269,6 +269,8 @@ adjustToxLoss(getToxLoss()-amount) /mob/living/carbon/human/adjustHalLoss(var/amount) + if (!amount) + return var/heal = (amount < 0) amount = abs(amount) var/list/pick_organs = organs.Copy() @@ -279,7 +281,8 @@ continue if(heal) - amount -= E.remove_pain(amount) + if(pain > 0) + amount -= E.remove_pain(amount) else amount -= E.add_pain(amount) BITSET(hud_updateflag, HEALTH_HUD) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 16958c324a2..e989ca3f273 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -510,7 +510,8 @@ update_damages() if(owner) owner.updatehealth() //droplimb will call updatehealth() again if it does end up being called - update_icon() + if (update_icon()) + SEND_SIGNAL(src, COMSIG_UPDATE_LIMB_IMAGE) return created_wound @@ -1357,6 +1358,7 @@ Note that amputating the affected organ does in fact remove the infection from t burn_mod = R.burn_mod robotize_type = company augment_limit += 1 //robotic limbs get one extra augment capacity + SEND_SIGNAL(src, COMSIG_UPDATE_LIMB_IMAGE) dislocated = -1 //TODO, make robotic limbs a separate type, remove snowflake limb_flags &= ~ORGAN_CAN_BREAK @@ -1707,6 +1709,7 @@ Note that amputating the affected organ does in fact remove the infection from t return var/last_pain = pain pain = max(0, min(species.total_health * 2, pain - amount)) + SEND_SIGNAL(src, COMSIG_UPDATE_LIMB_IMAGE) return -(pain-last_pain) /obj/item/organ/external/proc/add_pain(var/amount) diff --git a/html/changelogs/Fenodyree-HealthDollFix.yml b/html/changelogs/Fenodyree-HealthDollFix.yml new file mode 100644 index 00000000000..cdee34fc812 --- /dev/null +++ b/html/changelogs/Fenodyree-HealthDollFix.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Fenodyree + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixes the health doll not updating when pain goes away." + - bugfix: "Fixes robot limbs not showing in the health doll, unless they have been repaired."