bugfix for a crash with projectiles without particle system
only add a projectile if there is an enabled particlesystem
This commit is contained in:
parent
29ab1094ec
commit
7bf6fe756c
|
@ -946,7 +946,8 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
||||||
if(projectile){
|
if(projectile){
|
||||||
// create new projectile
|
// create new projectile
|
||||||
ProjectileType *projectileType=new ProjectileType();
|
ProjectileType *projectileType=new ProjectileType();
|
||||||
projectileTypes.push_back(projectileType);
|
//only add this projectile if there is an enabled particlesystem
|
||||||
|
//projectileTypes.push_back(projectileType);
|
||||||
projectileType->setAttackStartTime(attackStartTime);
|
projectileType->setAttackStartTime(attackStartTime);
|
||||||
projectileType->setDamagePercentage(100);
|
projectileType->setDamagePercentage(100);
|
||||||
//proj particle
|
//proj particle
|
||||||
|
@ -954,6 +955,7 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
|
||||||
const XmlNode *particleNode= projectileNode->getChild("particle");
|
const XmlNode *particleNode= projectileNode->getChild("particle");
|
||||||
bool particleEnabled= particleNode->getAttribute("value")->getBoolValue();
|
bool particleEnabled= particleNode->getAttribute("value")->getBoolValue();
|
||||||
if(particleEnabled){
|
if(particleEnabled){
|
||||||
|
projectileTypes.push_back(projectileType);
|
||||||
string path= particleNode->getAttribute("path")->getRestrictedValue();
|
string path= particleNode->getAttribute("path")->getRestrictedValue();
|
||||||
ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile();
|
ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile();
|
||||||
projectileParticleSystemType->load(particleNode, dir, currentPath + path,
|
projectileParticleSystemType->load(particleNode, dir, currentPath + path,
|
||||||
|
|
Loading…
Reference in New Issue