From 36f07c2590039e98a51ee7f1732422a2482f1612 Mon Sep 17 00:00:00 2001 From: Mythril382 <77225817+Mythril382@users.noreply.github.com> Date: Sat, 6 Jul 2024 12:17:22 +0800 Subject: [PATCH] im not even sure if this is reliable --- core/src/mindustry/logic/GlobalVars.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/mindustry/logic/GlobalVars.java b/core/src/mindustry/logic/GlobalVars.java index 9c0d128ec0..47292d4130 100644 --- a/core/src/mindustry/logic/GlobalVars.java +++ b/core/src/mindustry/logic/GlobalVars.java @@ -92,11 +92,13 @@ public class GlobalVars{ put("@ctrlCommand", ctrlCommand); //sounds - for(Sound sound : Core.assets.getAll(Sound.class, new Seq<>(Sound.class))){ - if(sound != Sounds.none && sound != Sounds.swish){ - String name = sound.file.nameWithoutExtension(); - soundNames.add(name); - put("@sfx-" + name, Sounds.getSoundId(sound)); + if(Core.assets != null){ + for(Sound sound : Core.assets.getAll(Sound.class, new Seq<>(Sound.class))){ + if(sound != Sounds.none && sound != Sounds.swish){ + String name = sound.file.nameWithoutExtension(); + soundNames.add(name); + put("@sfx-" + name, Sounds.getSoundId(sound)); + } } }