From 7ec02be1718d54f60235fdee52c698abc64a1d4f Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Fri, 1 Mar 2019 23:05:52 -0800 Subject: [PATCH] Changed play(String,boolean) behavior to return id of audio file, 0 if not found --- core/src/gdx/diablo/Audio.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/gdx/diablo/Audio.java b/core/src/gdx/diablo/Audio.java index 251d2091..e62924f4 100644 --- a/core/src/gdx/diablo/Audio.java +++ b/core/src/gdx/diablo/Audio.java @@ -84,10 +84,12 @@ public class Audio { play(sound, global); } - public void play(String id, boolean global) { - if (id.isEmpty()) return; + public int play(String id, boolean global) { + if (id.isEmpty()) return 0; Sounds.Entry sound = Diablo.files.Sounds.get(id); + if (sound == null) return 0; play(sound, global); + return sound.Index; } }