From f41e0f111de01d1ab8ee510b6813c5a80f572cec Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:24:24 -0400 Subject: [PATCH] External organ icon handling tweak (#18826) * Hm, let's try this * Nevermind, a new proc is better than doing a bunch of early returned jumps --- code/game/atoms.dm | 3 +++ code/modules/mob/living/carbon/human/update_icons.dm | 2 +- code/modules/surgery/organs/organ_external.dm | 9 ++++++--- code/modules/surgery/organs/organ_icon.dm | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f64e897f278..90848fc9a12 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -422,6 +422,9 @@ SIGNAL_HANDLER SHOULD_CALL_PARENT(TRUE) + if(updates & NONE) + return // NONE is being sent on purpose, and thus no signal should be sent. + updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates) if(updates & UPDATE_ICON_STATE) update_icon_state() diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index fcb5f543019..d3a84107fd1 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -144,7 +144,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) // blend the individual damage states with our icons for(var/D in bodyparts) var/obj/item/organ/external/E = D - E.update_icon() + E.update_state() if(E.damage_state == "00") continue diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index f873c2bab8d..468f8643fa8 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -7,6 +7,9 @@ max_damage = 0 dir = SOUTH organ_tag = "limb" + + blocks_emissive = FALSE + var/brute_mod = 1 var/burn_mod = 1 @@ -249,7 +252,7 @@ if(owner_old) owner_old.updatehealth("limb receive damage") - return update_icon() + return update_state() #undef LIMB_SHARP_THRESH_INT_DMG #undef LIMB_THRESH_INT_DMG @@ -269,7 +272,7 @@ if(updating_health) owner.updatehealth("limb heal damage") - return update_icon() + return update_state() /obj/item/organ/external/emp_act(severity) if(!is_robotic() || emp_proof) @@ -322,7 +325,7 @@ This function completely restores a damaged organ to perfect condition. if(owner) owner.updatehealth("limb rejuvenate") - update_icon() + update_state() if(!owner) START_PROCESSING(SSobj, src) diff --git a/code/modules/surgery/organs/organ_icon.dm b/code/modules/surgery/organs/organ_icon.dm index 2fc5555a4ee..16f07f225a0 100644 --- a/code/modules/surgery/organs/organ_icon.dm +++ b/code/modules/surgery/organs/organ_icon.dm @@ -185,8 +185,8 @@ GLOBAL_LIST_EMPTY(limb_icon_cache) // new damage icon system // adjusted to set damage_state to brute/burn code only (without r_name0 as before) -/obj/item/organ/external/update_icon(updates=ALL) - ..() + +/obj/item/organ/external/proc/update_state() var/n_is = damage_state_text() if(n_is != damage_state) damage_state = n_is