From 986de1066d9039a09c9295d075ee476cebdc7d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Tue, 12 Dec 2023 15:28:15 +0100 Subject: [PATCH] Fix uninitialized read of Engine::dt early after startup again As once done in a2c7242c7c63. Broken in c725894abd55. --- src/gui/interface/Engine.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/interface/Engine.cpp b/src/gui/interface/Engine.cpp index 0091d3484..4ccab0986 100644 --- a/src/gui/interface/Engine.cpp +++ b/src/gui/interface/Engine.cpp @@ -41,6 +41,15 @@ void Engine::SetFpsLimit(FpsLimit newFpsLimit) { fpsLimit = newFpsLimit; ::SetFpsLimit(fpsLimit); + // Populate dt with whatever that makes any sort of sense. + if (auto *explicitFpsLimit = std::get_if(&fpsLimit)) + { + SetFps(explicitFpsLimit->value); + } + else + { + SetFps(1); + } } void Engine::Begin()