Don't crash on invalid ksf files.
00... 40... 00... becomes 00... 10... 00...
This commit is contained in:
@@ -190,14 +190,17 @@ 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;
|
||||||
notedata.AddHoldNote( t, iHoldStartRow[t], iEndRow , TAP_ORIGINAL_HOLD_HEAD );
|
if( iHoldStartRow[t] == iEndRow )
|
||||||
|
notedata.SetTapNote( t, iHoldStartRow[t], TAP_ORIGINAL_TAP );
|
||||||
|
else
|
||||||
|
notedata.AddHoldNote( t, iHoldStartRow[t], iEndRow , TAP_ORIGINAL_HOLD_HEAD );
|
||||||
iHoldStartRow[t] = -1;
|
iHoldStartRow[t] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TapNote tap;
|
TapNote tap;
|
||||||
switch(sRowString[t])
|
switch(sRowString[t])
|
||||||
{
|
{
|
||||||
case '0': tap = TAP_EMPTY; break;
|
case '0': tap = TAP_EMPTY; break;
|
||||||
case '1': tap = TAP_ORIGINAL_TAP; break;
|
case '1': tap = TAP_ORIGINAL_TAP; break;
|
||||||
default:
|
default:
|
||||||
LOG->Warn( "File %s had an invalid row (\"%s\"); corrupt notes ignored",
|
LOG->Warn( "File %s had an invalid row (\"%s\"); corrupt notes ignored",
|
||||||
|
|||||||
Reference in New Issue
Block a user