mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 09:28:15 +03:00
Invert t comparison with -1 and un-nest rest of function
This is also another conditional where the rest of the function is nested. Furthermore, in order to not repeat ourselves, I've also decided to unconditionally assign currentsong to t, because if t is -1 currentsong gets assigned to -1 anyway - so it's the same thing, but it's much easier to see and think about.
This commit is contained in:
@@ -193,9 +193,12 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
||||
return;
|
||||
}
|
||||
|
||||
if (t != -1)
|
||||
currentsong = t;
|
||||
|
||||
if (t == -1)
|
||||
{
|
||||
currentsong = t;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!INBOUNDS_VEC(t, musicTracks))
|
||||
{
|
||||
@@ -237,11 +240,6 @@ void musicclass::play(int t, const double position_sec /*= 0.0*/, const int fade
|
||||
}
|
||||
|
||||
songStart = SDL_GetPerformanceCounter();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentsong = -1;
|
||||
}
|
||||
}
|
||||
|
||||
void musicclass::resume(const int fadein_ms /*= 0*/)
|
||||
|
||||
Reference in New Issue
Block a user