From 746ed8bcf051106b4399c2fec79c06520718ede1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=A6=E5=8F=B3=E7=9C=8B?= <1918891542@qq.com> Date: Wed, 16 Aug 2023 00:11:22 +0800 Subject: [PATCH] minor bug fix --- .../umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs index 8abd12e..6d9f41f 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs @@ -207,6 +207,10 @@ namespace Gallop.Live.Cutt if(thisList.Count > 0) { int ret = BinarySearchKey(0, thisList.Count - 1, currentTime); + if (ret == -1) + { + return null; + } thisTimeKeyIndex.index = ret; thisTimeKeyIndex.key = thisList[ret]; @@ -237,9 +241,9 @@ namespace Gallop.Live.Cutt float frame = time * 60; int mid = (low + high) / 2; - if (high <= 0) + if (high < 0) { - return 0; + return -1; } else if (low == high || (frame >= thisList[mid].frame && frame < thisList[mid + 1].frame)) {