From dc0b20ea60616b5ecac158360b05bcb807f143bd Mon Sep 17 00:00:00 2001 From: Raeschen Date: Thu, 14 Mar 2024 16:16:54 +0100 Subject: [PATCH] Soundloop runtime (#7959) --- code/datums/looping_sounds/_looping_sound.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/datums/looping_sounds/_looping_sound.dm b/code/datums/looping_sounds/_looping_sound.dm index 58c64ba0ae..74189128e3 100644 --- a/code/datums/looping_sounds/_looping_sound.dm +++ b/code/datums/looping_sounds/_looping_sound.dm @@ -59,6 +59,8 @@ return ..() /datum/looping_sound/proc/start(atom/add_thing, skip_start_sound = FALSE) + if(QDELETED(src)) //Chomp runtime + return //Chomp runtime if(add_thing) output_atoms |= add_thing if(timerid) @@ -84,7 +86,7 @@ started = FALSE /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() return if(!chance || prob(chance)) @@ -98,7 +100,7 @@ if(direct) S.channel = SSsounds.random_available_channel() 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] if(direct) if(ismob(thing))