From 313d6d0a00432ce5e9e6d5b7cd27c2a184d647d6 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 5 Sep 2022 02:16:58 +0700 Subject: [PATCH] Fix vote menu having a wrong mode selected by default --- sources/VotingHandlerAdapter.uc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/VotingHandlerAdapter.uc b/sources/VotingHandlerAdapter.uc index 7a77f67..f734c32 100644 --- a/sources/VotingHandlerAdapter.uc +++ b/sources/VotingHandlerAdapter.uc @@ -127,6 +127,10 @@ public final function InjectIntoVotingHandler() nextGameMode = GameMode(class'GameMode'.static .GetConfigInstance(availableGameModes[i])); newVotingHandlerConfig[i] = BuildVotingHandlerConfig(nextGameMode); + // Setup proper game mode index + if (availableGameModes[i].ToString() == targetGameMode) { + votingHandler.currentGameConfig = i; + } // Report omitted mutators / server options nextGameMode.ReportBadMutatorNames(); nextGameMode.ReportBadOptions(); @@ -295,6 +299,7 @@ public final function RestoreVotingHandlerConfigBackup() votingHandler.gameConfig = backupVotingHandlerConfig; votingHandler.default.gameConfig = backupVotingHandlerConfig; + votingHandler.currentGameConfig = 0; votingHandler.SaveConfig(); }