Stop goal sound when the game is terminated or restarted.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14405 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee
2013-11-10 09:53:36 +00:00
parent df66639717
commit e1bc4ef8fe
2 changed files with 16 additions and 2 deletions

View File

@@ -44,8 +44,16 @@ SoccerWorld::SoccerWorld() : WorldWithRank()
WorldStatus::setClockMode(CLOCK_CHRONO);
m_use_highscores = false;
} // SoccerWorld
//-----------------------------------------------------------------------------
/** The destructor frees al data structures.
*/
SoccerWorld::~SoccerWorld()
{
sfx_manager->deleteSFX(m_goal_sound);
} // ~SoccerWorld
//-----------------------------------------------------------------------------
/** Initializes the soccer world. It sets up the data structure
* to keep track of points etc. for each kart.
*/
@@ -95,6 +103,12 @@ void SoccerWorld::reset()
obj->reset();
obj->getPhysics()->reset();
}
if (m_goal_sound != NULL &&
m_goal_sound->getStatus() == SFXManager::SFX_PLAYING)
{
m_goal_sound->stop();
}
initKartList();
} // reset

View File

@@ -59,7 +59,7 @@ private:
public:
SoccerWorld();
virtual ~SoccerWorld() {}
virtual ~SoccerWorld();
virtual void init();