mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Fix play_ambience in Life() causing premature loops
This commit is contained in:
@@ -371,20 +371,22 @@ var/list/mob/living/forced_ambiance_list = new
|
||||
|
||||
L.lastarea = newarea
|
||||
L.lastareachange = world.time
|
||||
play_ambience(L)
|
||||
play_ambience(L, initial = TRUE)
|
||||
if(no_spoilers)
|
||||
L.disable_spoiler_vision()
|
||||
|
||||
/area/proc/play_ambience(var/mob/living/L)
|
||||
/area/proc/play_ambience(var/mob/living/L, initial = TRUE)
|
||||
// Ambience goes down here -- make sure to list each area seperately for ease of adding things in later, thanks! Note: areas adjacent to each other should have the same sounds to prevent cutoff when possible.- LastyScratch
|
||||
if(!(L && L.is_preference_enabled(/datum/client_preference/play_ambiance))) return
|
||||
|
||||
// If we previously were in an area with force-played ambiance, stop it.
|
||||
if(L in forced_ambiance_list)
|
||||
if((L in forced_ambiance_list) && initial)
|
||||
L << sound(null, channel = CHANNEL_AMBIENCE_FORCED)
|
||||
forced_ambiance_list -= L
|
||||
|
||||
if(forced_ambience)
|
||||
if(L in forced_ambiance_list)
|
||||
return
|
||||
if(forced_ambience.len)
|
||||
forced_ambiance_list |= L
|
||||
var/sound/chosen_ambiance = pick(forced_ambience)
|
||||
|
||||
@@ -325,7 +325,7 @@
|
||||
|
||||
for(var/mob/living/M in mobs_in_area(linkedholodeck))
|
||||
if(M.mind)
|
||||
linkedholodeck.play_ambience(M)
|
||||
linkedholodeck.play_ambience(M, initial = TRUE)
|
||||
|
||||
linkedholodeck.sound_env = A.sound_env
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
if(world.time >= (lastareachange + 30 SECONDS)) // Every 30 seconds, we're going to run a 35% chance to play ambience.
|
||||
var/area/A = get_area(src)
|
||||
if(A)
|
||||
A.play_ambience(src)
|
||||
A.play_ambience(src, initial = FALSE)
|
||||
|
||||
/mob/living/proc/update_pulling()
|
||||
if(pulling)
|
||||
|
||||
Reference in New Issue
Block a user