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();
|
size = particleSystemTypeNode->getAttribute("size")->getFloatValue();
|
||||||
sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->getFloatValue();
|
sizeNoEnergy = particleSystemTypeNode->getAttribute("sizeNoEnergy")->getFloatValue();
|
||||||
speed = particleSystemTypeNode->getAttribute("speed")->getFloatValue();
|
speed = particleSystemTypeNode->getAttribute("speed")->getFloatValue();
|
||||||
speedUpRelative = particleSystemTypeNode->getAttribute("speedUpRelative")->getFloatValue();
|
if(particleSystemTypeNode->hasAttribute("speedUpRelative")){
|
||||||
speedUpConstant = particleSystemTypeNode->getAttribute("speedUpConstant")->getFloatValue();
|
speedUpRelative = particleSystemTypeNode->getAttribute("speedUpRelative")->getFloatValue();
|
||||||
|
}
|
||||||
|
if(particleSystemTypeNode->hasAttribute("speedUpConstant")){
|
||||||
|
speedUpConstant = particleSystemTypeNode->getAttribute("speedUpConstant")->getFloatValue();
|
||||||
|
}
|
||||||
gravity = particleSystemTypeNode->getAttribute("gravity")->getFloatValue();
|
gravity = particleSystemTypeNode->getAttribute("gravity")->getFloatValue();
|
||||||
emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue();
|
emissionRate = particleSystemTypeNode->getAttribute("emissionRate")->getFloatValue();
|
||||||
energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue();
|
energyMax = particleSystemTypeNode->getAttribute("energyMax")->getIntValue();
|
||||||
|
@ -368,7 +372,6 @@ void ParticleSystemType::loadGame(const XmlNode *rootNode) {
|
||||||
children.push_back(child);
|
children.push_back(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0);
|
minmaxEnabled = (particleSystemTypeNode->getAttribute("minmaxEnabled")->getIntValue() != 0);
|
||||||
minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue();
|
minHp = particleSystemTypeNode->getAttribute("minHp")->getIntValue();
|
||||||
maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue();
|
maxHp = particleSystemTypeNode->getAttribute("maxHp")->getIntValue();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user