@@ -63,7 +63,7 @@ private void WarnParamsCount(int lineNo, ReadOnlySpan<char> line, Rational? time
6363 else if ( cmd is "FES_MODE" or "BPM_DEF" or "GENERATED_BY" && AssertInHeader ( lineNo , line ) ) { } // 这些不用解析,无事可做
6464 else if ( cmd == "RESOLUTION" && AssertInHeader ( lineNo , line ) )
6565 RSL = int . Parse ( values [ 1 ] ) ;
66- else if ( cmd == "CLOCK_DEF " && AssertInHeader ( lineNo , line ) )
66+ else if ( cmd == "CLK_DEF " && AssertInHeader ( lineNo , line ) )
6767 chart . ClockCount = int . Parse ( values [ 1 ] ) / ( RSL / 4 ) ;
6868 // BPM和MET
6969 else if ( cmd == "BPM" && values . Length == 4 && int . TryParse ( values [ 1 ] , out var bbar ) &&
@@ -109,7 +109,7 @@ private void WarnParamsCount(int lineNo, ReadOnlySpan<char> line, Rational? time
109109 }
110110 else if ( cc == "THO" && values . Length >= 8 && int . TryParse ( values [ 4 ] , out len ) )
111111 {
112- note = new TouchHold ( chart , time ) { TouchArea = values [ 4 ] + key , IsFirework = values [ 5 ] == "1" , TouchSize = values [ 6 ] } ;
112+ note = new TouchHold ( chart , time ) { TouchArea = values [ 5 ] + key , IsFirework = values [ 6 ] == "1" , TouchSize = values [ 7 ] } ;
113113 var duration = new Duration ( note ) { Bar = new Rational ( len , RSL ) } ;
114114 note . Duration = duration ;
115115 if ( values . Length != 8 ) WarnParamsCount ( lineNo , line , time ) ;
@@ -125,7 +125,7 @@ private void WarnParamsCount(int lineNo, ReadOnlySpan<char> line, Rational? time
125125 // 查找到前面的星星
126126 var a = _slides . GetValueOrDefault ( ( time , key ) ) ;
127127 if ( a == null || a . Count == 0 ) Fail ( Locale . MA2CNSlideNoPrevious , lineNo , line ) ;
128- slide = a [ 0 ] ;
128+ slide = a ! [ 0 ] ;
129129 a . RemoveAt ( 0 ) ; // 移除出来,因为一会会按照新的结束时间加回去
130130 }
131131 else
@@ -212,8 +212,8 @@ void pair()
212212 {
213213 for ( int i = 0 ; i < 8 ; i ++ )
214214 {
215- var pairedTap = taps [ i ] ;
216- if ( pairedTap == null ) continue ;
215+ if ( taps [ i ] == null || slideLists [ i ] . Count == 0 ) continue ; // 当前时刻、当前键位不是星星和tap都有,所以不配对
216+ var pairedTap = taps [ i ] ! ;
217217 toRemove . Add ( pairedTap ) ;
218218 for ( int j = 0 ; j < slideLists [ i ] . Count ; j ++ )
219219 {
@@ -236,7 +236,7 @@ void pair()
236236 }
237237 else if ( note . Time < now ) throw Utils . Fail ( "时间倒流,说明Chart.Sort写错了" ) ;
238238
239- if ( note is Tap tap ) taps [ tap . Key - 1 ] ??= tap ; // 只有在数组中原本为空的情况下才set。不然不set。这是因为万一有人写宴谱,在同一时刻同一键位上塞了大于一个tap(这显然是无理)怎么办(x)
239+ if ( note is Tap tap and not Hold ) taps [ tap . Key - 1 ] ??= tap ; // 只有在数组中原本为空的情况下才set。不然不set。这是因为万一有人写宴谱,在同一时刻同一键位上塞了大于一个tap(这显然是无理)怎么办(x)
240240 else if ( note is Slide slide ) slideLists [ slide . Key - 1 ] . Add ( slide ) ;
241241 }
242242 pair ( ) ; // 最后一个时刻
0 commit comments