1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-14 12:16:41 +00:00

Fix bug introduced in 0784d1b9df.

Thx Diablodoct0r for reporting.
Not sure if bug was harmless, maybe...
This commit is contained in:
fgenesis 2013-04-30 00:50:45 +02:00
parent 7d158f5f1c
commit a6929c51f2
2 changed files with 9 additions and 2 deletions

View file

@ -342,6 +342,7 @@ Shot::Shot() : Quad(), Segmented(0,0)
fired = false; fired = false;
target = 0; target = 0;
dead = false; dead = false;
enqueuedForDelete = false;
shotIdx = shots.size(); shotIdx = shots.size();
shots.push_back(this); shots.push_back(this);
} }
@ -487,7 +488,6 @@ void Shot::setLifeTime(float l)
void Shot::onEndOfLife() void Shot::onEndOfLife()
{ {
destroySegments(0.2); destroySegments(0.2);
deleteShots.push_back(this);
dead = true; dead = true;
if (emitter) if (emitter)
@ -495,6 +495,12 @@ void Shot::onEndOfLife()
emitter->killParticleEffect(); emitter->killParticleEffect();
emitter = 0; emitter = 0;
} }
if (!enqueuedForDelete)
{
enqueuedForDelete = true;
deleteShots.push_back(this);
}
} }
void Shot::doHitEffects() void Shot::doHitEffects()

View file

@ -128,7 +128,6 @@ public:
protected: protected:
float waveTimer; float waveTimer;
bool fired;
void suicide(); void suicide();
@ -141,6 +140,8 @@ protected:
void onEndOfLife(); void onEndOfLife();
bool dead; bool dead;
bool fired;
bool enqueuedForDelete;
void onUpdate(float dt); void onUpdate(float dt);
private: private: