From 835ca35065b3aaf7e4f657ebbdd6ede086e91deb Mon Sep 17 00:00:00 2001 From: Crash Cringle <30600688+CrashCringle12@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:58:38 -0500 Subject: [PATCH] Ensure the Group Offset is applied when Reloading a Song from Disk --- src/Song.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Song.cpp b/src/Song.cpp index 566da15cc3..49fdb5daa6 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -481,6 +481,7 @@ bool Song::ReloadFromSongDir( RString sDir ) return false; copy.RemoveAutoGenNotes(); *this = copy; + m_SongTiming.m_fBeat0GroupOffsetInSeconds = GetGroup()->GetSyncOffset(); /* Go through the steps, first setting their Song pointer to this song * (instead of the copy used above), and constructing a map to let us @@ -489,10 +490,14 @@ bool Song::ReloadFromSongDir( RString sDir ) for( std::vector::const_iterator it = m_vpSteps.begin(); it != m_vpSteps.end(); ++it ) { (*it)->m_pSong = this; - StepsID id; id.FromSteps( *it ); mNewSteps[id] = *it; + + // Reapply the Group Offset if the steps have their own timing data. + if( mNewSteps[id]->m_Timing.empty() ) + continue; + mNewSteps[id]->m_Timing.m_fBeat0GroupOffsetInSeconds = GetGroup()->GetSyncOffset(); } // Now we wipe out the new pointers, which were shallow copied and not deep copied...