From 901f8ae7d4ea71e25862c63d19ddd66c8edf86b7 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Tue, 12 Jan 2010 23:00:10 +0000 Subject: [PATCH] Bugfix: the rotating stars were being shown when restarting a race. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4443 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/stars.cpp | 7 +++++++ src/graphics/stars.hpp | 11 +++++------ src/karts/kart.cpp | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/graphics/stars.cpp b/src/graphics/stars.cpp index 1ec39cabf..49835256a 100644 --- a/src/graphics/stars.cpp +++ b/src/graphics/stars.cpp @@ -89,6 +89,13 @@ void Stars::showFor(float time) update(0); } +// ---------------------------------------------------------------------------- +/** Resets the stars, esp. disabling them at a restart. + */ +void Stars::reset() +{ + m_enabled = false; +} // unShow // ---------------------------------------------------------------------------- void Stars::update(float delta_t) diff --git a/src/graphics/stars.hpp b/src/graphics/stars.hpp index 221da2dff..881493c0e 100644 --- a/src/graphics/stars.hpp +++ b/src/graphics/stars.hpp @@ -45,12 +45,11 @@ private: float m_remaining_time; public: - Stars (scene::IAnimatedMeshSceneNode* parentKart); - ~Stars (); - //void show (); - void showFor (float time); - //void hide (); - void update (float delta_t); + Stars (scene::IAnimatedMeshSceneNode* parentKart); + ~Stars (); + void showFor(float time); + void reset(); + void update (float delta_t); }; #endif diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp index 4defb1273..b4578a4e8 100644 --- a/src/karts/kart.cpp +++ b/src/karts/kart.cpp @@ -380,7 +380,8 @@ void Kart::reset() m_controls.m_drift = false; m_controls.m_fire = false; m_controls.m_look_back = false; - + // Reset star effect in case that it is currently being shown. + m_stars_effect->reset(); m_vehicle->deactivateZipper(); // Set the brakes so that karts don't slide downhill