From a39007d48e9b3a88929c4da60b5a4a625f413251 Mon Sep 17 00:00:00 2001 From: Deve Date: Fri, 1 Jun 2018 22:11:16 +0200 Subject: [PATCH] Fixed invisible spare tire kart. Fixes #3277 --- src/karts/abstract_kart.hpp | 2 ++ src/karts/kart.cpp | 6 ++++++ src/karts/kart.hpp | 2 ++ src/modes/world.cpp | 6 ++++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/karts/abstract_kart.hpp b/src/karts/abstract_kart.hpp index 85a6ace85..8ac209d3f 100644 --- a/src/karts/abstract_kart.hpp +++ b/src/karts/abstract_kart.hpp @@ -517,6 +517,8 @@ public: virtual bool isJumping() const = 0; // ------------------------------------------------------------------------ virtual void playSound(SFXBuffer* buffer) = 0; + // ------------------------------------------------------------------------ + virtual bool isVisible() = 0; }; // AbstractKart diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index e8f729fe1..78321ecec 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -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 */ diff --git a/src/karts/kart.hpp b/src/karts/kart.hpp index 9b611c2fa..edb037d17 100644 --- a/src/karts/kart.hpp +++ b/src/karts/kart.hpp @@ -544,6 +544,8 @@ public: SFXBase* getNextEmitter(); // ------------------------------------------------------------------------ virtual void playSound(SFXBuffer* buffer) OVERRIDE; + // ------------------------------------------------------------------------ + virtual bool isVisible() OVERRIDE; }; // Kart diff --git a/src/modes/world.cpp b/src/modes/world.cpp index 267cf5749..fe70a436f 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -981,9 +981,11 @@ 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);