mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Invert currentsong check and un-nest rest of function
This removes an indentation level, and makes it easier to reason about the function since you essentially now view it as the function returning right there.
This commit is contained in:
@@ -188,8 +188,11 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
||||
safeToProcessMusic = true;
|
||||
musicVolume = MIX_MAX_VOLUME;
|
||||
|
||||
if (currentsong != t)
|
||||
if (currentsong == t)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (t != -1)
|
||||
{
|
||||
currentsong = t;
|
||||
@@ -239,7 +242,6 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
||||
{
|
||||
currentsong = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void musicclass::resume(const int fadein_ms /*= 0*/)
|
||||
|
||||
Reference in New Issue
Block a user