Fixed invisible spare tire kart.

Fixes #3277
This commit is contained in:
Deve 2018-06-01 22:11:16 +02:00
parent a9279a05d0
commit a39007d48e
4 changed files with 14 additions and 2 deletions

View File

@ -517,6 +517,8 @@ public:
virtual bool isJumping() const = 0;
// ------------------------------------------------------------------------
virtual void playSound(SFXBuffer* buffer) = 0;
// ------------------------------------------------------------------------
virtual bool isVisible() = 0;
}; // AbstractKart

View File

@ -3157,4 +3157,10 @@ const video::SColor& Kart::getColor() const
return m_kart_properties->getColor();
} // getColor
// ------------------------------------------------------------------------
bool Kart::isVisible()
{
return m_node && m_node->isVisible();
} // isVisible
/* EOF */

View File

@ -544,6 +544,8 @@ public:
SFXBase* getNextEmitter();
// ------------------------------------------------------------------------
virtual void playSound(SFXBuffer* buffer) OVERRIDE;
// ------------------------------------------------------------------------
virtual bool isVisible() OVERRIDE;
}; // Kart

View File

@ -981,10 +981,12 @@ void World::updateGraphics(float dt)
const int kart_amount = (int)m_karts.size();
for (int i = 0; i < kart_amount; ++i)
{
// Update all karts that are not eliminated
if (!m_karts[i]->isEliminated() )
// Update all karts that are visible
if (m_karts[i]->isVisible())
{
m_karts[i]->updateGraphics(dt);
}
}
projectile_manager->updateGraphics(dt);
Track::getCurrentTrack()->updateGraphics(dt);