Soundloop runtime (#7959)

This commit is contained in:
Raeschen
2024-03-14 16:16:54 +01:00
committed by GitHub
parent 0633907ac1
commit dc0b20ea60

View File

@@ -59,6 +59,8 @@
return ..() return ..()
/datum/looping_sound/proc/start(atom/add_thing, skip_start_sound = FALSE) /datum/looping_sound/proc/start(atom/add_thing, skip_start_sound = FALSE)
if(QDELETED(src)) //Chomp runtime
return //Chomp runtime
if(add_thing) if(add_thing)
output_atoms |= add_thing output_atoms |= add_thing
if(timerid) if(timerid)
@@ -84,7 +86,7 @@
started = FALSE started = FALSE
/datum/looping_sound/proc/sound_loop(starttime) /datum/looping_sound/proc/sound_loop(starttime)
if(max_loops && world.time >= starttime + mid_length * max_loops) if(QDELETED(src) || (max_loops && world.time >= starttime + mid_length * max_loops)) //ChompEDIT - runtime
stop() stop()
return return
if(!chance || prob(chance)) if(!chance || prob(chance))
@@ -98,7 +100,7 @@
if(direct) if(direct)
S.channel = SSsounds.random_available_channel() S.channel = SSsounds.random_available_channel()
S.volume = volume S.volume = volume
for(var/i in 1 to atoms_cache.len) for(var/i in 1 to atoms_cache?.len) //Chomp - runtime
var/atom/thing = atoms_cache[i] var/atom/thing = atoms_cache[i]
if(direct) if(direct)
if(ismob(thing)) if(ismob(thing))