Skip to content

Commit

Permalink
deaf fixes, potentially
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Nov 9, 2023
1 parent 79a9740 commit 4088d56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/living_health_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4088d56

Please sign in to comment.