Improves several Sound Loops' Performance

This commit is contained in:
CitadelStationBot
2017-07-31 14:35:16 -05:00
parent f53d66b319
commit 3d53f888b1
6 changed files with 20 additions and 8 deletions
+4 -1
View File
@@ -185,6 +185,9 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
/obj/effect/meteor/proc/meteor_effect()
if(heavy)
var/sound/meteor_sound = sound(meteorsound)
var/random_frequency = get_rand_frequency()
for(var/mob/M in GLOB.player_list)
if((M.orbiting) && (SSaugury.watchers[M]))
continue
@@ -193,7 +196,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
continue
var/dist = get_dist(M.loc, src.loc)
shake_camera(M, dist > 20 ? 2 : 4, dist > 20 ? 1 : 3)
M.playsound_local(src.loc, meteorsound, 50, 1, get_rand_frequency(), 10)
M.playsound_local(src.loc, null, 50, 1, random_frequency, 10, S = meteor_sound)
///////////////////////
//Meteor types
+3 -1
View File
@@ -456,10 +456,12 @@
if(charge<35)
charge += 1
if(world.time < stop && active)
var/sound/song_played = sound(selection.song_path)
for(var/mob/M in range(10,src))
if(!(M in rangers))
rangers[M] = TRUE
M.playsound_local(get_turf(M), selection.song_path, 100, channel = CHANNEL_JUKEBOX)
M.playsound_local(get_turf(M), null, 100, channel = CHANNEL_JUKEBOX, S = song_played)
if(prob(5+(allowed(M)*4)) && M.canmove)
dance(M)
for(var/mob/L in rangers)
+3 -1
View File
@@ -71,9 +71,11 @@
continue
LAZYADD(hearing_mobs, M)
last_hearcheck = world.time
var/sound/music_played = sound(soundfile)
for(var/i in hearing_mobs)
var/mob/M = i
M.playsound_local(source, soundfile, 100, falloff = 5)
M.playsound_local(source, null, 100, falloff = 5, S = music_played)
/datum/song/proc/updateDialog(mob/user)
instrumentObj.updateDialog() // assumes it's an object in world, override if otherwise