From 4088d56ba9ae21c18caadf8bdfb2cee273a1e62f Mon Sep 17 00:00:00 2001 From: Fira Date: Thu, 9 Nov 2023 23:25:43 +0000 Subject: [PATCH] deaf fixes, potentially --- .../carbon/human/life/handle_regular_status_updates.dm | 9 +++++---- code/modules/mob/living/living_health_procs.dm | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm index 281e6c33fb53..2d788abcd556 100644 --- a/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm +++ b/code/modules/mob/living/carbon/human/life/handle_regular_status_updates.dm @@ -99,13 +99,14 @@ AdjustEarDeafness(-1) - if(!ear_deaf && client && client.soundOutput) - client.soundOutput.status_flags ^= EAR_DEAF_MUTE - client.soundOutput.apply_status() - else if(ear_damage) ear_damage = max(ear_damage - 0.05, 0) + // This should be done only on updates abvoe, or even better in the AdjsutEarDeafnes handlers + if(!ear_deaf && (client?.soundOutput?.status_flags & EAR_DEAF_MUTE)) + client.soundOutput.status_flags ^= EAR_DEAF_MUTE + client.soundOutput.apply_status() + //Resting if(resting) dizziness = max(0, dizziness - 15) diff --git a/code/modules/mob/living/living_health_procs.dm b/code/modules/mob/living/living_health_procs.dm index 3cbfe2fc7294..5b27b9dab738 100644 --- a/code/modules/mob/living/living_health_procs.dm +++ b/code/modules/mob/living/living_health_procs.dm @@ -393,11 +393,16 @@ /mob/living/proc/on_deafness_gain() to_chat(src, SPAN_WARNING("You notice you can't hear anything... you're deaf!")) + // We should apply deafness here instead of in handle_regular_status_updates SEND_SIGNAL(src, COMSIG_MOB_DEAFENED) /mob/living/proc/on_deafness_loss() to_chat(src, SPAN_WARNING("You start hearing things again!")) SEND_SIGNAL(src, COMSIG_MOB_REGAINED_HEARING) + // Consider moving this to a signal on soundOutput. This is a fallback as handle_regular_status_updates SHOULD do the job. + if(!ear_deaf && (client?.soundOutput?.status_flags & EAR_DEAF_MUTE)) + client.soundOutput.status_flags ^= EAR_DEAF_MUTE + client.soundOutput.apply_status() // heal ONE limb, organ gets randomly selected from damaged ones. /mob/living/proc/heal_limb_damage(brute, burn)