mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Fixes possible runtimers (#18044)
whatever did call `stop()` with a valid `remove_thing` and with a nulled `output_atoms` shouldnt happen again. I think it was because I wasnt setting muted, or output_atoms lost its type when all `output_atoms` were removed.
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
|
||||
/datum/looping_sound/proc/start(atom/add_thing)
|
||||
if(add_thing)
|
||||
output_atoms |= add_thing
|
||||
LAZYADD(output_atoms, add_thing)
|
||||
if(!muted)
|
||||
return
|
||||
muted = FALSE
|
||||
@@ -60,8 +60,8 @@
|
||||
|
||||
/datum/looping_sound/proc/stop(atom/remove_thing, do_not_mute)
|
||||
if(remove_thing)
|
||||
output_atoms -= remove_thing
|
||||
if(do_not_mute)
|
||||
LAZYREMOVE(output_atoms, remove_thing)
|
||||
if(do_not_mute && length(output_atoms)) //if there are no output_atoms then we mute regardless of your preferance
|
||||
return
|
||||
if(muted)
|
||||
return
|
||||
@@ -80,8 +80,7 @@
|
||||
var/sound/S = sound(soundfile)
|
||||
if(direct)
|
||||
S.channel = channel || SSsounds.random_available_channel()
|
||||
for(var/i in 1 to atoms_cache.len)
|
||||
var/atom/thing = atoms_cache[i]
|
||||
for(var/atom/thing in atoms_cache)
|
||||
if(direct)
|
||||
if(ismob(thing))
|
||||
var/mob/M = thing
|
||||
|
||||
Reference in New Issue
Block a user