Fixed rare crash with explosions, when m_remaining_time is exactly equal to explosion_time
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6908 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
d737425fe5
commit
243c9f37c0
@ -30,7 +30,7 @@
|
||||
const float burst_time = 0.1f;
|
||||
|
||||
Explosion::Explosion(const Vec3& coord, const char* explosion_sound)
|
||||
{
|
||||
{
|
||||
m_remaining_time = burst_time; // short emision time, explosion, not constant flame
|
||||
m_node = irr_driver->addParticleNode();
|
||||
#ifdef DEBUG
|
||||
@ -137,6 +137,7 @@ void Explosion::update(float dt)
|
||||
{
|
||||
// Sound and animation finished --> remove node
|
||||
irr_driver->removeNode(m_node);
|
||||
m_node = NULL;
|
||||
projectile_manager->FinishedExplosion();
|
||||
return;
|
||||
}
|
||||
|
@ -39,14 +39,14 @@ private:
|
||||
SFXBase* m_explode_sound;
|
||||
float m_remaining_time;
|
||||
scene::IParticleSystemSceneNode *m_node;
|
||||
|
||||
|
||||
public:
|
||||
Explosion(const Vec3& coord, const char* explosion_sound);
|
||||
~Explosion();
|
||||
void init (const Vec3& coord);
|
||||
void update (float delta_t);
|
||||
int inUse ();
|
||||
bool hasEnded () { return m_remaining_time < -explosion_time; }
|
||||
bool hasEnded () { return m_remaining_time <= -explosion_time; }
|
||||
|
||||
} ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user