Prevent negative time in network soccer when finishing

This commit is contained in:
Benau 2018-07-19 01:17:52 +08:00
parent 6423925718
commit 1d7a9e9465
2 changed files with 4 additions and 1 deletions

View File

@ -472,6 +472,9 @@ bool SoccerWorld::isRaceOver()
*/
void SoccerWorld::countdownReachedZero()
{
// Prevent negative time in network soccer when finishing
m_time_ticks = 0;
m_time = 0.0f;
m_count_down_reached_zero = true;
} // countdownReachedZero

View File

@ -452,7 +452,7 @@ void WorldStatus::updateTime(int ticks)
m_count_up_ticks++;
}
if(m_time_ticks <= 0.0)
if (m_time_ticks <= 0)
{
// event
countdownReachedZero();