1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +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:
Misa 2021-02-12 12:43:06 -08:00 committed by Ethan Lee
parent 6dc423e78e
commit 968bb5f960

View file

@ -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")
{