Made configuration files with missing or too many entries abort STK.
This commit is contained in:
parent
48aca2f70f
commit
de44b2aaf9
@ -222,14 +222,14 @@ void PowerupManager::WeightsData::readData(int num_karts, const XMLNode *node)
|
|||||||
// Make sure we have the right number of entries
|
// Make sure we have the right number of entries
|
||||||
if (l.size() < 2 * (int)POWERUP_LAST)
|
if (l.size() < 2 * (int)POWERUP_LAST)
|
||||||
{
|
{
|
||||||
Log::error("PowerupManager",
|
Log::fatal("PowerupManager",
|
||||||
"Not enough entries for '%s' in powerup.xml",
|
"Not enough entries for '%s' in powerup.xml",
|
||||||
node->getName().c_str());
|
node->getName().c_str());
|
||||||
while (l.size() < 2 * (int)POWERUP_LAST) l.push_back(0);
|
while (l.size() < 2 * (int)POWERUP_LAST) l.push_back(0);
|
||||||
}
|
}
|
||||||
if(l.size()>2*(int)POWERUP_LAST)
|
if(l.size()>2*(int)POWERUP_LAST)
|
||||||
{
|
{
|
||||||
Log::error("PowerupManager",
|
Log::fatal("PowerupManager",
|
||||||
"Too many entries for '%s' in powerup.xml.",
|
"Too many entries for '%s' in powerup.xml.",
|
||||||
node->getName().c_str());
|
node->getName().c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user