aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-17 21:33:52 +0200
committer GitHub <noreply@github.com>2024-09-17 21:33:52 +0200
commitc1aeff2ceb179155e49ed9a518956ec85d5ac6cf (patch)
tree6aeada51e803b56beab81a3b2011ba1738c2fac2
parentdc0b0ede2368b43ab6c91a5e24d76ec34e91cf46 (diff)
parentb8cd7a732cbabc2c6d7e66c08814ca67a0e91479 (diff)
Merge pull request #272 from Nemrav/music_tweaks
music null check
-rw-r--r--extension/src/openvic-extension/singletons/SoundSingleton.cpp1
-rw-r--r--game/src/Game/MusicConductor/MusicConductor.gd5
2 files changed, 5 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/singletons/SoundSingleton.cpp b/extension/src/openvic-extension/singletons/SoundSingleton.cpp
index a32d9fe..b9a2ee3 100644
--- a/extension/src/openvic-extension/singletons/SoundSingleton.cpp
+++ b/extension/src/openvic-extension/singletons/SoundSingleton.cpp
@@ -1,7 +1,6 @@
#include "SoundSingleton.hpp"
#include <string_view>
-#include <vector>
#include <godot_cpp/core/error_macros.hpp>
#include <godot_cpp/variant/string.hpp>
diff --git a/game/src/Game/MusicConductor/MusicConductor.gd b/game/src/Game/MusicConductor/MusicConductor.gd
index 7103aff..f7e3b2a 100644
--- a/game/src/Game/MusicConductor/MusicConductor.gd
+++ b/game/src/Game/MusicConductor/MusicConductor.gd
@@ -96,9 +96,14 @@ func setup_compat_song(file_name) -> void:
var song = SongInfo.new()
var stream = SoundSingleton.get_song(file_name)
+ if stream == null:
+ push_error("Audio Stream for compat song %s was null" % file_name)
+ return
+
var metadata = MusicMetadata.new()
metadata.set_from_stream(stream)
var title = metadata.title
+
if title == "":
#use the file name without the extension if there's no metadata
title = file_name.split(".")[0]