bugfix: new attributes must not exist in older savegames
This commit is contained in:
parent
9e676a6e0e
commit
956671f018
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue