mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user