Stop world imer when game is paused

This commit is contained in:
auria.mg 2016-10-15 20:28:48 -04:00
parent 020edf1679
commit 929b9b5c20

View File

@ -379,11 +379,16 @@ void WorldStatus::updateTime(const float dt)
default: break;
}
IrrlichtDevice *device = irr_driver->getDevice();
switch (m_clock_mode)
{
case CLOCK_CHRONO:
if (!device->getTimer()->isStopped())
{
m_time += dt;
m_count_up_timer += dt;
}
break;
case CLOCK_COUNTDOWN:
// stop countdown when race is over
@ -394,8 +399,11 @@ void WorldStatus::updateTime(const float dt)
break;
}
if (!device->getTimer()->isStopped())
{
m_time -= dt;
m_count_up_timer += dt;
}
if(m_time <= 0.0)
{