From 27f896ba018a4ebeaee0179b7ecc617386a99a8c Mon Sep 17 00:00:00 2001 From: Ashiro12138 Date: Sun, 28 Jul 2024 18:15:11 +1000 Subject: [PATCH] BugFix/654 Fix dan-i dojo sub folder exit crash (#655) * At least it'll stop crashing * reset currently select song index to 0 upon exiting dan-i dojo --- OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs | 7 ++++--- OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs index 029c735c..39804af5 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CActSelect段位リスト.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using System; +using System.Drawing; using FDK; using Silk.NET.Maths; using static TJAPlayer3.CActSelect曲リスト; @@ -381,8 +382,8 @@ namespace TJAPlayer3 { private void tDrawDanSelectedLevel(float Anime, int modifier = 0) { int scroll = TJAPlayer3.Skin.Resolution[0] * modifier; - int currentSong = n現在の選択行 + modifier; - bool over4 = false; + int currentSong = Math.Clamp(n現在の選択行 + modifier, 0, stバー情報.Length - 1); + bool over4 = false; switch (stバー情報[currentSong].eノード種別) { case CSongListNode.ENodeType.SCORE: { diff --git a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs index 5ae3e7c5..5e09a7a0 100644 --- a/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs +++ b/OpenTaiko/src/Stages/05.DaniSelect/CStage段位選択.cs @@ -204,6 +204,7 @@ namespace TJAPlayer3 { if (TJAPlayer3.InputManager.Keyboard.KeyPressed((int)SlimDXKeys.Key.Escape) || TJAPlayer3.Pad.bPressed(EInstrumentPad.DRUMS, EPad.Cancel)) { + this.段位リスト.n現在の選択行 = 0; return returnTitle(); } }