Release skidding key when kart was stopped, on rescue animation etc.

Also avoid reset skidding in every frame when speed is equal to 0.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14351 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee 2013-10-30 18:57:24 +00:00
parent fdb2a06535
commit 4c88999317

View File

@ -74,6 +74,7 @@ void Skidding::reset()
m_jump_speed = 0.0f;
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
m_kart->getControls().m_skid = KartControl::SC_NONE;
} // reset
// ----------------------------------------------------------------------------
@ -121,7 +122,6 @@ void Skidding::updateSteering(float steer, float dt)
else if (m_visual_rotation < -0.05f) m_visual_rotation += 0.05f;
else
{
m_visual_rotation = 0;
reset();
}
break;
@ -212,7 +212,8 @@ void Skidding::update(float dt, bool is_on_ground,
}
// No skidding backwards or while stopped
if(m_kart->getSpeed() < 0.001f)
if(m_kart->getSpeed() < 0.001f &&
m_skid_state != SKID_NONE && m_skid_state != SKID_BREAK)
{
m_skid_state = SKID_BREAK;
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);