From 666333b4a1622832ff927ca03379a4946c8be097 Mon Sep 17 00:00:00 2001 From: titiger Date: Sat, 19 Jul 2014 19:29:41 +0200 Subject: [PATCH] new style projectiles must have a particle system --- source/glest_game/types/projectile_type.cpp | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/source/glest_game/types/projectile_type.cpp b/source/glest_game/types/projectile_type.cpp index ab77addd..3b80c054 100644 --- a/source/glest_game/types/projectile_type.cpp +++ b/source/glest_game/types/projectile_type.cpp @@ -53,19 +53,16 @@ void ProjectileType::load(const XmlNode *projectileNode, const string &dir, cons { attackStartTime=0.0f; } - if(projectileNode->hasChild("particle")){ - const XmlNode *particleNode= projectileNode->getChild("particle"); - bool particleEnabled= particleNode->getAttribute("value")->getBoolValue(); - if(particleEnabled){ - string path= particleNode->getAttribute("path")->getRestrictedValue(); - ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); - projectileParticleSystemType->load(particleNode, dir, currentPath + path, - &Renderer::getInstance(), loadedFileList, parentLoader, - techtreepath); - loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); - setProjectileParticleSystemType(projectileParticleSystemType); - } - } + + // projectiles MUST have a particle system. + const XmlNode *particleNode= projectileNode->getChild("particle"); + string path= particleNode->getAttribute("path")->getRestrictedValue(); + ParticleSystemTypeProjectile* projectileParticleSystemType= new ParticleSystemTypeProjectile(); + projectileParticleSystemType->load(particleNode, dir, currentPath + path, + &Renderer::getInstance(), loadedFileList, parentLoader, + techtreepath); + loadedFileList[currentPath + path].push_back(make_pair(parentLoader,particleNode->getAttribute("path")->getRestrictedValue())); + setProjectileParticleSystemType(projectileParticleSystemType); if(projectileNode->hasChild("hitshake")){ const XmlNode *hitShakeNode= projectileNode->getChild("hitshake");