fixes ghost hearing (#14534)

This commit is contained in:
Tom
2022-06-27 00:06:26 +01:00
committed by GitHub
parent 8f3e9f095d
commit 430f5d3661
2 changed files with 5 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(mobs)
wait = 2 SECONDS wait = 2 SECONDS
var/list/currentrun = list() var/list/currentrun = list()
///only contains living players for some reason
var/static/list/clients_by_zlevel[][] var/static/list/clients_by_zlevel[][]
var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that. var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when z2 is created and new_players can login before that.
var/static/list/cubemonkeys = list() var/static/list/cubemonkeys = list()

View File

@@ -68,11 +68,6 @@
if(below_turf && istransparentturf(turf_source)) if(below_turf && istransparentturf(turf_source))
listeners += SSmobs.clients_by_zlevel[below_turf.z] listeners += SSmobs.clients_by_zlevel[below_turf.z]
for(var/mob/listening_mob as anything in listeners)
if(get_dist(listening_mob, turf_source) <= maxdistance)
listening_mob.playsound_local(turf_source, soundin, vol, vary, frequency, falloff_exponent, channel, pressure_affected, S, maxdistance, falloff_distance, 1, use_reverb)
. += listening_mob
else //these sounds don't carry through walls else //these sounds don't carry through walls
listeners = get_hearers_in_view(maxdistance, turf_source) listeners = get_hearers_in_view(maxdistance, turf_source)