From 92b096c159024a119f4ae7826fd4a2f26cbae699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DragonRatTiger=20/=20=E3=83=AA=E3=83=A5=E3=82=A6=E3=82=B3?= Date: Sat, 19 Oct 2024 13:16:33 -0500 Subject: [PATCH] oops, that change breaks towers (#707) --- .../07.Game/Taiko/CActImplBackground.cs | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs index 3cd4e5bc..dc5c9f46 100644 --- a/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs +++ b/OpenTaiko/src/Stages/07.Game/Taiko/CActImplBackground.cs @@ -44,9 +44,6 @@ namespace OpenTaiko { var bgOrigindir = CSkin.Path($"{TextureLoader.BASE}{TextureLoader.GAME}{TextureLoader.BACKGROUND}"); var preset = HScenePreset.GetBGPreset(); - - if (preset == null) return; - if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Tower) { bgOrigindir += "Tower"; } else if (OpenTaiko.stageSongSelect.nChoosenSongDifficulty[0] == (int)Difficulty.Dan) { @@ -63,18 +60,15 @@ namespace OpenTaiko { var upDirs = System.IO.Directory.GetDirectories($@"{bgOrigindir}{Path.DirectorySeparatorChar}Up"); // If there is a preset upper background and this preset exists on the skin use it, else random upper background - if (preset.UpperBackground != null) { - var _presetPath = (preset.UpperBackground.Length > 0) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : ""; - var upPath = (Directory.Exists(_presetPath)) - ? _presetPath - : (upDirs.Length > 0 ? upDirs[random.Next(0, upDirs.Length)] : ""); + var _presetPath = (preset != null && preset.UpperBackground != null) ? $@"{bgOrigindir}{Path.DirectorySeparatorChar}Up{Path.DirectorySeparatorChar}" + preset.UpperBackground[random.Next(0, preset.UpperBackground.Length)] : ""; + var upPath = (preset != null && System.IO.Directory.Exists(_presetPath)) + ? _presetPath + : upDirs[random.Next(0, upDirs.Length)]; - UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); - UpScript.Init(); - } + UpScript = new ScriptBG($@"{upPath}{Path.DirectorySeparatorChar}Script.lua"); + UpScript.Init(); - if (UpScript == null) IsUpNotFound = true; - else IsUpNotFound = !UpScript.Exists(); + IsUpNotFound = false; } else { IsUpNotFound = true; }