bugfix: new attributes must not exist in older savegames

This commit is contained in:
titiger 2014-11-29 19:25:33 +01:00
parent 9e676a6e0e
commit 956671f018
1 changed files with 6 additions and 3 deletions

View File

@ -346,8 +346,12 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
size = particleSystemTypeNode->getAttribute("size")->getFloatValue();
sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->getFloatValue();
speed = particleSystemTypeNode->getAttribute("speed")->getFloatValue();
speedUpRelative = particleSystemTypeNode->getAttribute("speedUpRelative")->getFloatValue();
speedUpConstant = particleSystemTypeNode->getAttribute("speedUpConstant")->getFloatValue();
if(particleSystemTypeNode->hasAttribute("speedUpRelative")){
speedUpRelative = particleSystemTypeNode->getAttribute("speedUpRelative")->getFloatValue();
}
if(particleSystemTypeNode->hasAttribute("speedUpConstant")){
speedUpConstant = particleSystemTypeNode->getAttribute("speedUpConstant")->getFloatValue();
}
gravity = particleSystemTypeNode->getAttribute("gravity")->getFloatValue();
emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue();
energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue();
@ -368,7 +372,6 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
children.push_back(child);
}
}
minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0);
minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue();
maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue();