From 929b9b5c20152ef0db67a4ec1070a01f3275e1df Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 15 Oct 2016 20:28:48 -0400 Subject: [PATCH] Stop world imer when game is paused --- src/modes/world_status.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/modes/world_status.cpp b/src/modes/world_status.cpp index 6f053e299..6cf5cd65d 100644 --- a/src/modes/world_status.cpp +++ b/src/modes/world_status.cpp @@ -379,11 +379,16 @@ void WorldStatus::updateTime(const float dt) default: break; } + IrrlichtDevice *device = irr_driver->getDevice(); + switch (m_clock_mode) { case CLOCK_CHRONO: - m_time += dt; - m_count_up_timer += dt; + 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; } - m_time -= dt; - m_count_up_timer += dt; + if (!device->getTimer()->isStopped()) + { + m_time -= dt; + m_count_up_timer += dt; + } if(m_time <= 0.0) {