Merge pull request #4210 from Citadel-Station-13/upstream-merge-33185

[MIRROR] Adds quiet argument to playsound.
This commit is contained in:
deathride58
2017-12-04 21:09:24 +00:00
committed by GitHub
+5 -2
View File
@@ -1,4 +1,4 @@
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE)
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE)
if(isarea(source))
throw EXCEPTION("playsound(): source is an area")
return
@@ -11,7 +11,10 @@
// Looping through the player list has the added bonus of working for mobs inside containers
var/sound/S = sound(get_sfx(soundin))
var/maxdistance = (world.view + extrarange) * 3
for(var/P in GLOB.player_list)
var/list/listeners = GLOB.player_list
if(!ignore_walls) //these sounds don't carry through walls
listeners = listeners & hearers(maxdistance,turf_source)
for(var/P in listeners)
var/mob/M = P
if(!M || !M.client)
continue