[MIRROR] Moves playsound_local() to mob and gets rid of a useless proc. (#710)

* Moves playsound_local() to mob and gets rid of a useless proc.

* Fixes compile errors
This commit is contained in:
CitadelStationBot
2017-05-18 01:39:16 -05:00
committed by Poojawa
parent fd778d9810
commit 47fa8353eb
6 changed files with 16 additions and 20 deletions
+1 -1
View File
@@ -85,7 +85,7 @@
return
if(!allowed(user))
to_chat(user,"<span class='warning'>Error: Access Denied - Message: Only the engineering department can be trusted with this kind of power.</span>")
playsound_local(src,'sound/misc/compiler-failure.ogg', 25, 1)
user.playsound_local(src,'sound/misc/compiler-failure.ogg', 25, 1)
return
if(!Adjacent(user) && !isAI(user))
return
+3 -2
View File
@@ -183,8 +183,9 @@
if(!T)
return
if(triggerer_only)
A.playsound_local(T, sound, volume, freq_vary)
if(triggerer_only && ismob(A))
var/mob/B = A
B.playsound_local(T, sound, volume, freq_vary)
else
playsound(T, sound, volume, freq_vary, extra_range)
+4 -9
View File
@@ -23,10 +23,10 @@
if(T && T.z == turf_source.z)
M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, surround, channel, pressure_affected)
/atom/proc/playsound_direct(soundin, vol as num, vary, frequency, falloff, surround = TRUE, channel = 0, pressure_affected = FALSE)
playsound_local(get_turf(src), soundin, vol, vary, frequency, falloff, surround, channel)
/mob/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1, channel = 0, pressure_affected = TRUE)
if(!client || !can_hear())
return
/atom/proc/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1, channel = 0, pressure_affected = TRUE)
soundin = get_sfx(soundin)
var/sound/S = sound(soundin)
@@ -76,15 +76,10 @@
// The y value is for above your head, but there is no ceiling in 2d spessmens.
S.y = 1
S.falloff = (falloff ? falloff : FALLOFF_SOUNDS)
S.falloff = falloff || FALLOFF_SOUNDS
src << S
/mob/playsound_local(turf/turf_source, soundin, vol as num, vary, frequency, falloff, surround = 1, channel = 0, pressure_affected = TRUE)
if(!client || !can_hear())
return
..()
/proc/open_sound_channel()
var/static/next_channel = 1 //loop through the available 1024 - (the ones we reserve) channels and pray that its not still being used
. = ++next_channel