From 9787e01acfd783f36722a23f1403147a3ba88291 Mon Sep 17 00:00:00 2001 From: sukibaby <163092272+sukibaby@users.noreply.github.com> Date: Tue, 11 Mar 2025 09:32:18 -0700 Subject: [PATCH] Add braces to Song::ReloadFromSongDir The LOG->Warn line is being executed unconditionally due to the the lack of braces. The indentation is misleading as a result. This adds braces to ensure the intended behavior is performed. --- src/Song.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Song.cpp b/src/Song.cpp index 4a175a0ef5..5f84886768 100644 --- a/src/Song.cpp +++ b/src/Song.cpp @@ -498,12 +498,18 @@ bool Song::ReloadFromSongDir( RString sDir ) // Reapply the Group Offset if the steps have their own timing data. if( mNewSteps[id]->m_Timing.empty() ) + { continue; + } if (SONGMAN->GetGroup(this) != nullptr) + { mNewSteps[id]->m_Timing.m_fBeat0GroupOffsetInSeconds = SONGMAN->GetGroup(this)->GetSyncOffset(); + } else + { m_SongTiming.m_fBeat0GroupOffsetInSeconds = PREFSMAN->m_fMachineSyncBias; LOG->Warn("Song %s has no group, using machine sync bias.", m_sMainTitle.c_str()); + } } // Now we wipe out the new pointers, which were shallow copied and not deep copied... @@ -2587,4 +2593,4 @@ LUA_REGISTER_CLASS( Song ) * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. - */ \ No newline at end of file + */