From e64996695fe5a35247d4c88bd98c7a7516f1552e Mon Sep 17 00:00:00 2001 From: Andriy Logvin Date: Tue, 23 Jul 2024 18:08:18 +0100 Subject: [PATCH] fix(game/five): fix switching to build 1604 After we moved list of game builds into lua dictionary in premake5_builds.lua file - we can not rely on order of builds in GAME_BUILDS define. However GetGameBuildInit was doing so. It would set the default build to be the last one in the list. Which was expected to be the lowest one. On the other hand, when switching builds, we dont write build 1604 as a flag in CLI because we expect it to be the default one anyway. As a result - when trying to writch into build 1604 game would go into infinite restart loop. This commit sets default build in GetGameBuildInit explicitly. We so it the same way in all other places, so there is no reason to try to get smallest build from GAME_BUILDS list. --- code/client/shared/XBRInit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/client/shared/XBRInit.cpp b/code/client/shared/XBRInit.cpp index 5665da89f5..1cbfeeffe3 100644 --- a/code/client/shared/XBRInit.cpp +++ b/code/client/shared/XBRInit.cpp @@ -21,7 +21,7 @@ int GetGameBuildInit() auto sharedData = CfxState::Get(); std::wstring_view cli = (sharedData->initCommandLine[0]) ? sharedData->initCommandLine : GetCommandLineW(); - auto buildNumber = std::get<1>(buildNumbers[std::size(buildNumbers) - 1]); + auto buildNumber = 1604; for (auto [build, number] : buildNumbers) {