Properly clear nitro on restart, plus fix some silly code where sometimes we carefully check if (m_nitro) before using the pointer, and at other times we use the pointer without checking
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9785 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -289,6 +289,13 @@ void ParticleEmitter::setPosition(const Vec3 &pos)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ParticleEmitter::clearParticles()
|
||||
{
|
||||
m_node->clearParticles();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ParticleEmitter::setParticleType(const ParticleKind* type)
|
||||
{
|
||||
assert(m_magic_number == 0x58781325);
|
||||
|
||||
@@ -89,7 +89,9 @@ public:
|
||||
|
||||
void setParticleType(const ParticleKind* p);
|
||||
|
||||
void resizeBox(float size);
|
||||
void resizeBox(float size);
|
||||
|
||||
void clearParticles();
|
||||
|
||||
scene::IParticleSystemSceneNode* getNode() { return m_node; }
|
||||
|
||||
|
||||
@@ -506,7 +506,12 @@ void Kart::reset()
|
||||
m_kart_model->setAnimation(KartModel::AF_DEFAULT);
|
||||
m_view_blocked_by_plunger = 0.0;
|
||||
m_attachment->clear();
|
||||
m_nitro->setCreationRate(0.0f);
|
||||
if (m_nitro)
|
||||
{
|
||||
m_nitro->setCreationRate(0.0f);
|
||||
m_nitro->clearParticles();
|
||||
}
|
||||
|
||||
m_zipper_fire->setCreationRate(0.0f);
|
||||
if (m_collision_particles) m_collision_particles->setCreationRate(0.0f);
|
||||
m_powerup.reset();
|
||||
@@ -875,7 +880,7 @@ void Kart::update(float dt)
|
||||
}
|
||||
} // UserConfigParams::m_graphical_effects
|
||||
|
||||
m_nitro->update(dt);
|
||||
if (m_nitro) m_nitro->update(dt);
|
||||
m_zipper_fire->update(dt);
|
||||
if (m_collision_particles) m_collision_particles->update(dt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user