1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Use returns and don't have rest of loadcustomlevelstats in an 'else'

This will cut down on unnecessary indentation levels.
This commit is contained in:
Misa 2020-06-29 18:44:54 -07:00
parent 9a008dc77c
commit be9c405ddd

View file

@ -580,17 +580,20 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore)
void Game::loadcustomlevelstats()
{
//testing
if(!customlevelstatsloaded)
if(customlevelstatsloaded)
{
return;
}
tinyxml2::XMLDocument doc;
if (!FILESYSTEM_loadTiXml2Document("saves/levelstats.vvv", doc))
{
//No levelstats file exists; start new
customlevelstats.clear();
savecustomlevelstats();
return;
}
else
{
// Old system
std::vector<std::string> customlevelnames;
std::vector<int> customlevelscores;
@ -689,8 +692,6 @@ void Game::loadcustomlevelstats()
CustomLevelStat stat = {customlevelnames[i], customlevelscores[i]};
customlevelstats.push_back(stat);
}
}
}
}
void Game::savecustomlevelstats()