Try to fix speedy end controller in network race

This commit is contained in:
Benau 2018-08-04 00:02:52 +08:00
parent ce58014cab
commit 9e6ebe6097

View File

@ -104,7 +104,6 @@ EndController::EndController(AbstractKart *kart,
#ifdef AI_DEBUG
m_debug_sphere = irr_driver->getSceneManager()->addSphereSceneNode(1);
#endif
m_kart->setSlowdown(MaxSpeed::MS_DECREASE_AI, 0.3f, 2);
// Set the name of the previous controller as this controller name, otherwise
// we get the incorrect name when printing statistics in profile mode.
@ -195,6 +194,9 @@ void EndController::update(int ticks)
m_controls->setBrake(m_kart->getSpeed()>0);
return;
}
// Keep update slow down in case for network rewind overwrite it
m_kart->setSlowdown(MaxSpeed::MS_DECREASE_AI, 0.3f, 2);
/*Get information that is needed by more than 1 of the handling funcs*/
//Detect if we are going to crash with the track and/or kart
calcSteps();