Fix uninitialized read of Engine::dt early after startup again

As once done in a2c7242c7c. Broken in c725894abd.
This commit is contained in:
Tamás Bálint Misius 2023-12-12 15:28:15 +01:00
parent d4784b2516
commit 986de1066d
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -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<FpsLimitExplicit>(&fpsLimit))
{
SetFps(explicitFpsLimit->value);
}
else
{
SetFps(1);
}
}
void Engine::Begin()