- bugfix for attackboost, don't try to make particle on affected units if particle not defined in xml

This commit is contained in:
Mark Vejvoda 2011-07-12 00:58:09 +00:00
parent 9bc26f418d
commit 44c73392ee
1 changed files with 10 additions and 8 deletions

View File

@ -1749,6 +1749,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
//printf("#2 wasAlive = %d hp = %d boosthp = %d\n",wasAlive,hp,boost->boostUpgrade.getMaxHp());
if(showUnitParticles == true) {
if(boost->unitParticleSystemTypeForAffectedUnit != NULL) {
effect->upst = new UnitParticleSystemType();
*effect->upst = *boost->unitParticleSystemTypeForAffectedUnit;
//effect.upst = boost->unitParticleSystemTypeForAffectedUnit;
@ -1759,6 +1760,7 @@ bool Unit::applyAttackBoost(const AttackBoost *boost, const Unit *source) {
effect->ups->setFactionColor(getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0));
Renderer::getInstance().manageParticleSystem(effect->ups, rsGame);
}
}
currentAttackBoostEffects.push_back(effect);
if(wasAlive == true) {