Fixes mobs hearing different explosion sounds (#25731)

This commit is contained in:
Cyberboss
2017-04-01 11:14:13 -04:00
committed by KorPhaeron
parent b32836f053
commit 8b8b9f54b5
+2 -1
View File
@@ -51,6 +51,7 @@ var/explosionid = 1
if(!silent)
var/frequency = get_rand_frequency()
var/ex_sound = get_sfx("explosion")
for(var/mob/M in player_list)
// Double check for client
if(M && M.client)
@@ -59,7 +60,7 @@ var/explosionid = 1
var/dist = get_dist(M_turf, epicenter)
// 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
M.playsound_local(epicenter, ex_sound, 100, 1, frequency, falloff = 5)
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = Clamp(far_dist, 30, 50) // Volume is based on explosion size and dist