Reset position of soccer ball when game is restarted

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14116 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
deveee 2013-09-20 21:25:26 +00:00
parent 71bca15228
commit 42fd3a2343

View File

@ -75,6 +75,21 @@ void SoccerWorld::reset()
m_can_score_points = true;
memset(m_team_goals, 0, sizeof(m_team_goals));
// Reset original positions for the soccer balls
TrackObjectManager* tom = getTrack()->getTrackObjectManager();
assert(tom);
PtrVector<TrackObject>& objects = tom->getObjects();
for(int i=0; i<objects.size(); i++)
{
TrackObject* obj = objects.get(i);
if(!obj->isSoccerBall())
continue;
obj->reset();
obj->getPhysics()->reset();
}
initKartList();
} // reset
@ -130,8 +145,8 @@ void SoccerWorld::onCheckGoalTriggered(bool first_goal)
if(!obj->isSoccerBall())
continue;
obj->reset();
obj->getPhysics()->reset();
obj->reset();
obj->getPhysics()->reset();
}
//Resetting the ball triggers the goal check line one more time.