diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index aaedf69a9e..1d2735c8ad 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -20,7 +20,7 @@ static void HandleBunki( TimingData &timing, const float fEarlyBPM, timing.AddSegment( SEGMENT_BPM, new BPMSegment(beat, fCurBPM) ); } -static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, bool bKIUCompliant ) +static bool LoadFromKSFFile( const RString &sPath, Steps &out, Song &song, bool bKIUCompliant ) { LOG->Trace( "Steps::LoadFromKSFFile( '%s' )", sPath.c_str() ); @@ -308,6 +308,13 @@ static bool LoadFromKSFFile( const RString &sPath, Steps &out, const Song &song, TAP_ORIGINAL_HOLD_HEAD ); } } + /* have this row be the last moment in the song, unless + * a future step ends later. */ + float curTime = stepsTiming.GetElapsedTimeFromBeat(fCurBeat); + if (curTime > song.GetSpecifiedLastSecond()) + { + song.SetSpecifiedLastSecond(curTime); + } break; } diff --git a/src/Song.cpp b/src/Song.cpp index da0b73bcfc..604953e83d 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -41,7 +41,7 @@ * @brief The internal version of the cache for StepMania. * * Increment this value to invalidate the current cache. */ -const int FILE_CACHE_VERSION = 195; +const int FILE_CACHE_VERSION = 196; /** @brief How long does a song sample last by default? */ const float DEFAULT_MUSIC_SAMPLE_LENGTH = 12.f; @@ -866,7 +866,8 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache) } } - this->firstSecond = localFirst; + // Yes, for some reason we can have freaky stuff take place here. + this->firstSecond = (localFirst < localLast) ? localFirst : 0; this->lastSecond = localLast; }