Stop world imer when game is paused
This commit is contained in:
parent
020edf1679
commit
929b9b5c20
@ -379,11 +379,16 @@ void WorldStatus::updateTime(const float dt)
|
|||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IrrlichtDevice *device = irr_driver->getDevice();
|
||||||
|
|
||||||
switch (m_clock_mode)
|
switch (m_clock_mode)
|
||||||
{
|
{
|
||||||
case CLOCK_CHRONO:
|
case CLOCK_CHRONO:
|
||||||
m_time += dt;
|
if (!device->getTimer()->isStopped())
|
||||||
m_count_up_timer += dt;
|
{
|
||||||
|
m_time += dt;
|
||||||
|
m_count_up_timer += dt;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CLOCK_COUNTDOWN:
|
case CLOCK_COUNTDOWN:
|
||||||
// stop countdown when race is over
|
// stop countdown when race is over
|
||||||
@ -394,8 +399,11 @@ void WorldStatus::updateTime(const float dt)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_time -= dt;
|
if (!device->getTimer()->isStopped())
|
||||||
m_count_up_timer += dt;
|
{
|
||||||
|
m_time -= dt;
|
||||||
|
m_count_up_timer += dt;
|
||||||
|
}
|
||||||
|
|
||||||
if(m_time <= 0.0)
|
if(m_time <= 0.0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user