Index: source/main.cpp =================================================================== --- source/main.cpp +++ source/main.cpp @@ -678,16 +678,23 @@ else if (!InitNonVisual(args)) g_Shutdown = ShutdownType::Quit; - std::optional rlInterface{g_Shutdown == ShutdownType::None ? - CreateRLInterface(args) : std::nullopt}; + std::optional rlInterface{[&]() -> std::optional + { + if (g_Shutdown == ShutdownType::None) + return std::nullopt; + else + return CreateRLInterface(args); + }()}; while (g_Shutdown == ShutdownType::None) + { if (isVisual) Frame(rlInterface ? &*rlInterface : nullptr); else if(rlInterface) rlInterface->TryApplyMessage(); else NonVisualFrame(); + } // Do not install mods again in case of restart (typically from the mod selector) modsToInstall.clear();