bugfix for a crash with projectiles without particle system

only add a projectile if there is an enabled particlesystem
This commit is contained in:
titiger 2014-11-25 00:56:59 +01:00
parent 29ab1094ec
commit 7bf6fe756c
1 changed files with 3 additions and 1 deletions

View File

@ -946,7 +946,8 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
if(projectile){
// create new projectile
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->setDamagePercentage(100);
//proj particle
@ -954,6 +955,7 @@ void AttackSkillType::load(const XmlNode *sn, const XmlNode *attackBoostsNode,
const XmlNode *particleNode= projectileNode->getChild("particle");
bool particleEnabled= particleNode->getAttribute("value")->getBoolValue();
if(particleEnabled){
projectileTypes.push_back(projectileType);
string path= particleNode->getAttribute("path")->getRestrictedValue();
ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile();
projectileParticleSystemType->load(particleNode, dir, currentPath + path,