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 bool isJumping() const = 0;
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
virtual void playSound(SFXBuffer* buffer) = 0; virtual void playSound(SFXBuffer* buffer) = 0;
// ------------------------------------------------------------------------
virtual bool isVisible() = 0;
}; // AbstractKart }; // AbstractKart

View File

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

View File

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

View File

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