mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-11-05 02:39:41 +01:00
De-duplicate <customlevelscore> loading to use LOAD_ARRAY_RENAME()
This now means every XML array loading is done with common, re-duplicated code. The only exceptions to this are special cases other than the the majority of cases; the majority being a simple matter of reading an array of integers and putting it into another array. Seems like the only reason I hadn't caught the <customlevelscore> tag until now was because I was focused on de-duplicating all the array loads in Game::loadstats() and below, forgetting about Game::loadcustomlevelstats().
This commit is contained in:
parent
6dc423e78e
commit
968bb5f960
1 changed files with 1 additions and 12 deletions
|
@ -540,18 +540,7 @@ void Game::loadcustomlevelstats()
|
|||
pText = "";
|
||||
}
|
||||
|
||||
if (pKey == "customlevelscore")
|
||||
{
|
||||
std::string TextString = (pText);
|
||||
if(TextString.length())
|
||||
{
|
||||
std::vector<std::string> values = split(TextString,',');
|
||||
for(size_t i = 0; i < values.size(); i++)
|
||||
{
|
||||
customlevelscores.push_back(help.Int(values[i].c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
LOAD_ARRAY_RENAME(customlevelscore, customlevelscores)
|
||||
|
||||
if (pKey == "customlevelstats")
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue