Don't crash on invalid ksf files.

00...
40...
00...
becomes
00...
10...
00...
This commit is contained in:
Steve Checkoway
2006-07-08 00:58:43 +00:00
parent f6d496c5cc
commit 46611abb9a
+3
View File
@@ -190,6 +190,9 @@ bool KSFLoader::LoadFromKSFFile( const RString &sPath, Steps &out, const Song &s
{ {
int iEndKSFRow = r-1; int iEndKSFRow = r-1;
int iEndRow = (iEndKSFRow * ROWS_PER_BEAT) / iTickCount; int iEndRow = (iEndKSFRow * ROWS_PER_BEAT) / iTickCount;
if( iHoldStartRow[t] == iEndRow )
notedata.SetTapNote( t, iHoldStartRow[t], TAP_ORIGINAL_TAP );
else
notedata.AddHoldNote( t, iHoldStartRow[t], iEndRow , TAP_ORIGINAL_HOLD_HEAD ); notedata.AddHoldNote( t, iHoldStartRow[t], iEndRow , TAP_ORIGINAL_HOLD_HEAD );
iHoldStartRow[t] = -1; iHoldStartRow[t] = -1;
} }