diff --git a/src/main_loop.cpp b/src/main_loop.cpp index b46631ce9..85d065a54 100644 --- a/src/main_loop.cpp +++ b/src/main_loop.cpp @@ -159,7 +159,8 @@ float MainLoop::getLimitedDt() // when the computer can't keep it up, slow down the shown time instead // But this can not be done in networking, otherwise the game time on // client and server will not be in synch anymore - if(!NetworkConfig::get()->isNetworking()) + if (!NetworkConfig::get()->isNetworking() || + !World::getWorld()) { /* time 3 internal substeps take */ const float MAX_ELAPSED_TIME = 3.0f*1.0f / 60.0f*1000.0f; diff --git a/src/modes/demo_world.cpp b/src/modes/demo_world.cpp index 078ba1268..4343527d9 100644 --- a/src/modes/demo_world.cpp +++ b/src/modes/demo_world.cpp @@ -28,9 +28,11 @@ #include "tracks/track.hpp" #include "tracks/track_manager.hpp" +#include + std::vector DemoWorld::m_demo_tracks; int DemoWorld::m_default_num_karts = 2; -float DemoWorld::m_max_idle_time = 99999.0f; +float DemoWorld::m_max_idle_time = std::numeric_limits::max(); float DemoWorld::m_current_idle_time = 0; bool DemoWorld::m_do_demo = false; @@ -104,6 +106,9 @@ void DemoWorld::enterRaceOverState() */ bool DemoWorld::updateIdleTimeAndStartDemo(float dt) { + // Demo world is disabled if max float + if (m_max_idle_time == std::numeric_limits::max()) + return false; // We get crashes if stk is activated when a modal dialog is open if(GUIEngine::ModalDialog::isADialogActive()) return false;