mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01: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:
parent
96c479a11f
commit
fe5bacfdc2
1 changed files with 4 additions and 2 deletions
|
@ -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*/)
|
||||
|
|
Loading…
Reference in a new issue