use a bool instead of a (unused) pointer.
This commit is contained in:
parent
dff810a5b1
commit
c081862070
|
@ -2601,7 +2601,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){
|
||||||
if(ast == NULL) {
|
if(ast == NULL) {
|
||||||
throw megaglest_runtime_error("Start attack particle ast == NULL!");
|
throw megaglest_runtime_error("Start attack particle ast == NULL!");
|
||||||
}
|
}
|
||||||
ParticleSystemTypeProjectile *pstProj= NULL;
|
bool hasProjectile = false;
|
||||||
ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType();
|
ParticleSystemTypeSplash *pstSplash= ast->getSplashParticleType();
|
||||||
|
|
||||||
Vec3f startPos= unit->getCurrVector();
|
Vec3f startPos= unit->getCurrVector();
|
||||||
|
@ -2621,16 +2621,16 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){
|
||||||
psProj->setPath(startPos, endPos);
|
psProj->setPath(startPos, endPos);
|
||||||
psProj->setObserver(new ParticleDamager(unit, this, gameCamera));
|
psProj->setObserver(new ParticleDamager(unit, this, gameCamera));
|
||||||
psProj->setVisible(visible);
|
psProj->setVisible(visible);
|
||||||
if(unit->getFaction()->getTexture()) {
|
if(unit->getFaction()->getTexture()) {
|
||||||
psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
|
psProj->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
|
||||||
}
|
}
|
||||||
renderer.manageParticleSystem(psProj, rsGame);
|
renderer.manageParticleSystem(psProj, rsGame);
|
||||||
unit->addAttackParticleSystem(psProj);
|
unit->addAttackParticleSystem(psProj);
|
||||||
pstProj=(*pit);
|
hasProjectile=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no projectile, still deal damage..
|
// if no projectile, still deal damage..
|
||||||
if(pstProj == NULL) {
|
if(hasProjectile == true) {
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj");
|
snprintf(szBuf,8095,"Unit hitting [startAttackParticleSystem] no proj");
|
||||||
unit->addNetworkCRCDecHp(szBuf);
|
unit->addNetworkCRCDecHp(szBuf);
|
||||||
|
@ -2646,7 +2646,7 @@ void UnitUpdater::startAttackParticleSystem(Unit *unit){
|
||||||
psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
|
psSplash->setFactionColor(unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
|
||||||
}
|
}
|
||||||
renderer.manageParticleSystem(psSplash, rsGame);
|
renderer.manageParticleSystem(psSplash, rsGame);
|
||||||
if(pstProj!=NULL){
|
if(hasProjectile == true){
|
||||||
psProj->link(psSplash);
|
psProj->link(psSplash);
|
||||||
}
|
}
|
||||||
unit->addAttackParticleSystem(psSplash);
|
unit->addAttackParticleSystem(psSplash);
|
||||||
|
|
Loading…
Reference in New Issue