Makes sounds with a low enough volume only audible within line of sight (#6515)

It has been posited that it doesn't make sense to hear certain sounds through walls. So, I proceeded to go and change that.

All sounds with a volume of 50 or less will now be played only to the "hearers" list. This is basically people within line of sight. I also rewrote the lower levels of the sound API with this. The code is now more modular, while retaining the same main API entry point playsound.

This needs a test merge to see how badly I broke shit.
This commit is contained in:
Erki
2019-07-13 17:50:01 +03:00
committed by GitHub
parent d67d9e7061
commit 514e1f2aa4
8 changed files with 153 additions and 105 deletions
+1 -1
View File
@@ -425,7 +425,7 @@
if(M.client)
if(!M) return
shake_camera(M, 5, 1)
M.playsound_local(our_turf, 'sound/effects/alert.ogg', 100, 1, 0.5)
M.playsound_simple(our_turf, 'sound/effects/alert.ogg', 100, use_random_freq = TRUE, falloff = 0.5)
/obj/machinery/gravity_generator/main/proc/update_list(var/gravity_changed = FALSE)
var/turf/T = get_turf(src.loc)