mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09: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:
parent
9a008dc77c
commit
be9c405ddd
1 changed files with 6 additions and 5 deletions
|
@ -580,17 +580,20 @@ void Game::updatecustomlevelstats(std::string clevel, int cscore)
|
||||||
void Game::loadcustomlevelstats()
|
void Game::loadcustomlevelstats()
|
||||||
{
|
{
|
||||||
//testing
|
//testing
|
||||||
if(!customlevelstatsloaded)
|
if(customlevelstatsloaded)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tinyxml2::XMLDocument doc;
|
tinyxml2::XMLDocument doc;
|
||||||
if (!FILESYSTEM_loadTiXml2Document("saves/levelstats.vvv", doc))
|
if (!FILESYSTEM_loadTiXml2Document("saves/levelstats.vvv", doc))
|
||||||
{
|
{
|
||||||
//No levelstats file exists; start new
|
//No levelstats file exists; start new
|
||||||
customlevelstats.clear();
|
customlevelstats.clear();
|
||||||
savecustomlevelstats();
|
savecustomlevelstats();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Old system
|
// Old system
|
||||||
std::vector<std::string> customlevelnames;
|
std::vector<std::string> customlevelnames;
|
||||||
std::vector<int> customlevelscores;
|
std::vector<int> customlevelscores;
|
||||||
|
@ -690,8 +693,6 @@ void Game::loadcustomlevelstats()
|
||||||
customlevelstats.push_back(stat);
|
customlevelstats.push_back(stat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Game::savecustomlevelstats()
|
void Game::savecustomlevelstats()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue