Replaying now loops back to the beginning of the recording. Note that
atm the physics values of karts (speed, suspension etc) are not reset, which can cause difference when looping. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/physics@10201 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
d2d8ec970d
commit
311fef8726
@ -124,12 +124,18 @@ void History::updateSaving(float dt)
|
||||
void History::updateReplay(float dt)
|
||||
{
|
||||
m_current++;
|
||||
World *world = World::getWorld();
|
||||
if(m_current>=(int)m_all_deltas.size())
|
||||
{
|
||||
printf("Replay finished.\n");
|
||||
exit(2);
|
||||
m_current = 0;
|
||||
// Note that for physics replay all physics parameters
|
||||
// need to be reset, e.g. velocity, ...
|
||||
for(unsigned int i=0; i<world->getNumKarts(); i++)
|
||||
{
|
||||
world->getKart(i)->reset();
|
||||
}
|
||||
}
|
||||
World *world = World::getWorld();
|
||||
unsigned int num_karts = world->getNumKarts();
|
||||
for(unsigned k=0; k<num_karts; k++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user