From fd645aabfacff66150b230c231db32cc8fef4d9b Mon Sep 17 00:00:00 2001 From: Raymond Lynch Date: Sun, 11 Jul 2021 20:40:54 -0400 Subject: [PATCH] Invalid SetBGM value sets bgm to default instead --- Dalamud/Interface/Internal/DalamudCommands.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/DalamudCommands.cs b/Dalamud/Interface/Internal/DalamudCommands.cs index 4353a3fee..6e0f5e7a6 100644 --- a/Dalamud/Interface/Internal/DalamudCommands.cs +++ b/Dalamud/Interface/Internal/DalamudCommands.cs @@ -221,7 +221,15 @@ namespace Dalamud.Interface.Internal private void OnBgmSetCommand(string command, string arguments) { - this.dalamud.Framework.Gui.SetBgm(ushort.Parse(arguments)); + if (ushort.TryParse(arguments, out var value)) + { + this.dalamud.Framework.Gui.SetBgm(value); + } + else + { + // Revert to the original BGM by specifying an invalid one + this.dalamud.Framework.Gui.SetBgm(9999); + } } private void OnDebugDrawDevMenu(string command, string arguments)