Removed shadow when kart is rescued, too.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2942 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2009-01-16 01:01:27 +00:00
parent a370685685
commit 8ab51b0c72

View File

@ -638,13 +638,16 @@ void Kart::update(float dt)
item_manager->hitItem(this); item_manager->hitItem(this);
m_skidmarks->update(dt); m_skidmarks->update(dt);
// Remove the shadow if the kart is not on the ground // Remove the shadow if the kart is not on the ground (if a kart
if(!isOnGround() && m_shadow_enabled) // is rescued isOnGround might still be true, since the kart rigid
// body was removed from the physics, but still retain the old
// values for the raycasts).
if( (!isOnGround() || m_rescue) && m_shadow_enabled)
{ {
m_shadow_enabled = false; m_shadow_enabled = false;
m_model_transform->removeKid(m_shadow); m_model_transform->removeKid(m_shadow);
} }
if(isOnGround() && !m_shadow_enabled) if(!m_shadow_enabled && isOnGround() && !m_rescue)
{ {
m_shadow_enabled = true; m_shadow_enabled = true;
m_model_transform->addKid(m_shadow); m_model_transform->addKid(m_shadow);