mirror of
https://github.com/glest/glest-source.git
synced 2025-02-24 11:42:31 +01:00
- 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) {
|
||||
(*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) {
|
||||
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
||||
@ -1307,6 +1310,11 @@ bool Unit::update() {
|
||||
(*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) {
|
||||
UnitAttackBoostEffect &effect = currentAttackBoostEffects[i];
|
||||
if(effect.ups != NULL) {
|
||||
@ -2236,6 +2244,15 @@ void Unit::stopDamageParticles(bool force) {
|
||||
}
|
||||
// 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) {
|
||||
for(int i = damageParticleSystems.size()-1; i >= 0; --i) {
|
||||
UnitParticleSystem *ps = damageParticleSystems[i];
|
||||
@ -2399,8 +2416,8 @@ void Unit::startDamageParticles() {
|
||||
ups->setMaxParticleEnergy(150);
|
||||
ups->setSizeNoEnergy(type->getSize()*0.6f);
|
||||
ups->setParticleSize(type->getSize()*0.8f);
|
||||
damageParticleSystems.push_back(ups);
|
||||
damageParticleSystemsInUse[-1] = ups;
|
||||
smokeParticleSystems.push_back(ups);
|
||||
//damageParticleSystemsInUse[-1] = ups;
|
||||
Renderer::getInstance().manageParticleSystem(ups, rsGame);
|
||||
}
|
||||
}
|
||||
|
@ -330,6 +330,7 @@ private:
|
||||
std::map<int, UnitParticleSystem *> damageParticleSystemsInUse;
|
||||
|
||||
vector<ParticleSystem*> fireParticleSystems;
|
||||
vector<UnitParticleSystem*> smokeParticleSystems;
|
||||
|
||||
CardinalDir modelFacing;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user