- bugfix for start / stop smoke particles
This commit is contained in:
parent
14c70966b0
commit
a8b25cf111
|
@ -738,6 +738,9 @@ void Unit::setVisible(const bool visible) {
|
||||||
for(UnitParticleSystems::iterator it= damageParticleSystems.begin(); it != damageParticleSystems.end(); ++it) {
|
for(UnitParticleSystems::iterator it= damageParticleSystems.begin(); it != damageParticleSystems.end(); ++it) {
|
||||||
(*it)->setVisible(visible);
|
(*it)->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
for(UnitParticleSystems::iterator it= smokeParticleSystems.begin(); it != smokeParticleSystems.end(); ++it) {
|
||||||
|
(*it)->setVisible(visible);
|
||||||
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i < currentAttackBoostEffects.size(); ++i) {
|
for(unsigned int i = 0; i < currentAttackBoostEffects.size(); ++i) {
|
||||||
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
||||||
|
@ -1307,6 +1310,11 @@ bool Unit::update() {
|
||||||
(*it)->setRotation(getRotation());
|
(*it)->setRotation(getRotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(UnitParticleSystems::iterator it= smokeParticleSystems.begin(); it != smokeParticleSystems.end(); ++it) {
|
||||||
|
(*it)->setPos(getCurrVector());
|
||||||
|
(*it)->setRotation(getRotation());
|
||||||
|
}
|
||||||
|
|
||||||
for(unsigned int i = 0; i < currentAttackBoostEffects.size(); ++i) {
|
for(unsigned int i = 0; i < currentAttackBoostEffects.size(); ++i) {
|
||||||
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
||||||
if(effect.ups != NULL) {
|
if(effect.ups != NULL) {
|
||||||
|
@ -2236,6 +2244,15 @@ void Unit::stopDamageParticles(bool force) {
|
||||||
}
|
}
|
||||||
// stop additional particles
|
// stop additional particles
|
||||||
|
|
||||||
|
|
||||||
|
if(smokeParticleSystems.size() > 0) {
|
||||||
|
for(int i = smokeParticleSystems.size()-1; i >= 0; --i) {
|
||||||
|
UnitParticleSystem *ps = smokeParticleSystems[i];
|
||||||
|
ps->fade();
|
||||||
|
smokeParticleSystems.pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(damageParticleSystems.size() > 0) {
|
if(damageParticleSystems.size() > 0) {
|
||||||
for(int i = damageParticleSystems.size()-1; i >= 0; --i) {
|
for(int i = damageParticleSystems.size()-1; i >= 0; --i) {
|
||||||
UnitParticleSystem *ps = damageParticleSystems[i];
|
UnitParticleSystem *ps = damageParticleSystems[i];
|
||||||
|
@ -2399,8 +2416,8 @@ void Unit::startDamageParticles() {
|
||||||
ups->setMaxParticleEnergy(150);
|
ups->setMaxParticleEnergy(150);
|
||||||
ups->setSizeNoEnergy(type->getSize()*0.6f);
|
ups->setSizeNoEnergy(type->getSize()*0.6f);
|
||||||
ups->setParticleSize(type->getSize()*0.8f);
|
ups->setParticleSize(type->getSize()*0.8f);
|
||||||
damageParticleSystems.push_back(ups);
|
smokeParticleSystems.push_back(ups);
|
||||||
damageParticleSystemsInUse[-1] = ups;
|
//damageParticleSystemsInUse[-1] = ups;
|
||||||
Renderer::getInstance().manageParticleSystem(ups, rsGame);
|
Renderer::getInstance().manageParticleSystem(ups, rsGame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,6 +330,7 @@ private:
|
||||||
std::map<int, UnitParticleSystem *> damageParticleSystemsInUse;
|
std::map<int, UnitParticleSystem *> damageParticleSystemsInUse;
|
||||||
|
|
||||||
vector<ParticleSystem*> fireParticleSystems;
|
vector<ParticleSystem*> fireParticleSystems;
|
||||||
|
vector<UnitParticleSystem*> smokeParticleSystems;
|
||||||
|
|
||||||
CardinalDir modelFacing;
|
CardinalDir modelFacing;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue