From c08186207021db35439c62ae5aac8f28122ef044 Mon Sep 17 00:00:00 2001 From: titiger Date: Fri, 11 Jul 2014 00:26:16 +0200 Subject: [PATCH] use a bool instead of a (unused) pointer. --- source/glest_game/world/unit_updater.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/glest_game/world/unit_updater.cpp b/source/glest_game/world/unit_updater.cpp index 8fb76f91..a52aa757 100644 --- a/source/glest_game/world/unit_updater.cpp +++ b/source/glest_game/world/unit_updater.cpp @@ -2601,7 +2601,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ if(ast == NULL) { throw megaglest_runtime_error("Start attack particle ast == NULL!"); } - ParticleSystemTypeProjectile *pstProj= NULL; + bool hasProjectile = false; ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType(); Vec3f startPos= unit->getCurrVector(); @@ -2621,16 +2621,16 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ psProj->setPath(startPos, endPos); psProj->setObserver(new ParticleDamager(unit, this, gameCamera)); psProj->setVisible(visible); - if(unit->getFaction()->getTexture()) { - psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); - } - renderer.manageParticleSystem(psProj, rsGame); - unit->addAttackParticleSystem(psProj); - pstProj=(*pit); + if(unit->getFaction()->getTexture()) { + psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); + } + renderer.manageParticleSystem(psProj, rsGame); + unit->addAttackParticleSystem(psProj); + hasProjectile=true; } // if no projectile, still deal damage.. - if(pstProj == NULL) { + if(hasProjectile == true) { char szBuf[8096]=""; snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj"); unit->addNetworkCRCDecHp(szBuf); @@ -2646,7 +2646,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){ psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0)); } renderer.manageParticleSystem(psSplash, rsGame); - if(pstProj!=NULL){ + if(hasProjectile == true){ psProj->link(psSplash); } unit->addAttackParticleSystem(psSplash);