mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Fixes an outofbounds exception and a nullpointerexception in ambience (#21743)
This commit is contained in:
@@ -30,6 +30,8 @@ client/proc/handle_ambience()
|
|||||||
return
|
return
|
||||||
|
|
||||||
var/list/possible_ambience = get_ambience()
|
var/list/possible_ambience = get_ambience()
|
||||||
|
if(!possible_ambience)
|
||||||
|
return
|
||||||
if(last_ambient_noise)
|
if(last_ambient_noise)
|
||||||
var/cancel_ambience = TRUE
|
var/cancel_ambience = TRUE
|
||||||
for(var/amb in possible_ambience)
|
for(var/amb in possible_ambience)
|
||||||
@@ -44,7 +46,7 @@ client/proc/handle_ambience()
|
|||||||
if(ambience_buffer > world.timeofday)
|
if(ambience_buffer > world.timeofday)
|
||||||
return //sound's playing. don't bother.
|
return //sound's playing. don't bother.
|
||||||
|
|
||||||
if(possible_ambience.len > 1)//more than one thing. no repeats!
|
if(possible_ambience.len)
|
||||||
for(var/datum/ambience/ambie in possible_ambience)
|
for(var/datum/ambience/ambie in possible_ambience)
|
||||||
if(last_ambient_noise == ambie.sound)
|
if(last_ambient_noise == ambie.sound)
|
||||||
possible_ambience -= ambie
|
possible_ambience -= ambie
|
||||||
|
|||||||
Reference in New Issue
Block a user