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