summaryrefslogtreecommitdiff
path: root/client/audio
diff options
context:
space:
mode:
Diffstat (limited to 'client/audio')
-rw-r--r--client/audio/play_random.gd2
-rw-r--r--client/audio/play_random.tscn2
2 files changed, 3 insertions, 1 deletions
diff --git a/client/audio/play_random.gd b/client/audio/play_random.gd
index efaad7d8..df77de2f 100644
--- a/client/audio/play_random.gd
+++ b/client/audio/play_random.gd
@@ -48,6 +48,8 @@ func configure_player(player):
player.attenuation_filter_cutoff_hz = 20500
func play_random():
+ if sounds.size() == 0: return
+
var s = sounds[randi_range(0, sounds.size() - 1)]
s.pitch_scale = randf_range(0.9, 1.1)
s.play()
diff --git a/client/audio/play_random.tscn b/client/audio/play_random.tscn
index 44f3a10b..f9b20842 100644
--- a/client/audio/play_random.tscn
+++ b/client/audio/play_random.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=2 format=3 uid="uid://bbyb6s110my8c"]
+[gd_scene load_steps=2 format=3 uid="uid://bncx0wul2ikrg"]
[ext_resource type="Script" path="res://audio/play_random.gd" id="1_c8pxf"]