From 89b05ca18b95e6cdfe01e41bfbccf69fdd791cd9 Mon Sep 17 00:00:00 2001 From: Rykka Stormheart Date: Fri, 10 Mar 2023 03:47:03 -0800 Subject: [PATCH 1/2] Fixes Explosions runtiming Explosions will no longer try to play the deaf_loop on ghosts and then cause a runtime. --- code/game/objects/explosion.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 24eaf70d85..4df9613078 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -38,8 +38,8 @@ // If inside the blast radius + world.view - 2 if(dist <= round(max_range + world.view - 2, 1)) M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound - var/mob/living/mL = M // CHOMPStation Add: Ear Ringing/Deafness - mL.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness + if(isliving(M)) + M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness else if(dist <= far_dist) var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion From 69aee543a06e4c809fb8c19ba2f8ecc19041fd6e Mon Sep 17 00:00:00 2001 From: Rykka Stormheart Date: Fri, 10 Mar 2023 03:59:19 -0800 Subject: [PATCH 2/2] Gotta typecast, oops --- code/game/objects/explosion.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 4df9613078..e6f05306f8 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -38,8 +38,9 @@ // If inside the blast radius + world.view - 2 if(dist <= round(max_range + world.view - 2, 1)) M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound - if(isliving(M)) - M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness + var/mob/living/mL = M // CHOMPStation Edit: Ear Ringing/Deaf + if(isliving(mL)) // CHOMPStation Edit: Fix + mL.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness else if(dist <= far_dist) var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion