From ed9fbd2c3194793543299468ccb1580409f244d6 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Sun, 19 May 2013 21:42:54 -0700 Subject: [PATCH] Filter out zero BPMs and zero-length stops in first pass It turns out to be much cleaner to do this here than to do it later. --- src/NotesLoaderSM.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/NotesLoaderSM.cpp b/src/NotesLoaderSM.cpp index ef1811a9eb..074e3168ad 100644 --- a/src/NotesLoaderSM.cpp +++ b/src/NotesLoaderSM.cpp @@ -230,6 +230,11 @@ void SMLoader::ParseBPMs( vector< pair > &out, const RString line, const float fBeat = RowToBeat( arrayBPMChangeValues[0], rowsPerBeat ); const float fNewBPM = StringToFloat( arrayBPMChangeValues[1] ); + if( fNewBPM == 0 ) { + LOG->UserLog("Song file", this->GetSongTitle(), + "has a zero BPM; ignored."); + continue; + } out.push_back( make_pair(fBeat, fNewBPM) ); } @@ -308,6 +313,11 @@ void SMLoader::ParseStops( vector< pair > &out, const RString line const float fFreezeBeat = RowToBeat( arrayFreezeValues[0], rowsPerBeat ); const float fFreezeSeconds = StringToFloat( arrayFreezeValues[1] ); + if( fFreezeSeconds == 0 ) { + LOG->UserLog("Song file", this->GetSongTitle(), + "has a zero-length stop; ignored."); + continue; + } out.push_back( make_pair(fFreezeBeat, fFreezeSeconds) ); }