From bf938016e9db646d9ecc3fb5c633bed1e75a75aa Mon Sep 17 00:00:00 2001 From: Lukas Bagaric Date: Mon, 1 Jan 2024 12:17:17 +0100 Subject: [PATCH] Fix Multi-Rounds Detected As Crashes (#25) --- Classes/MutVoteSys.uc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Classes/MutVoteSys.uc b/Classes/MutVoteSys.uc index 9b6ad5d..7985cfa 100644 --- a/Classes/MutVoteSys.uc +++ b/Classes/MutVoteSys.uc @@ -33,6 +33,7 @@ var EGameState GameState; var int TimeCounter; var int IdleTime; var bool bIsMultiRound; +var bool bConfiguredTempData; var bool bChangeMapImmediately; var bool bIsDefaultMap; var class TimeMessageClass; @@ -533,12 +534,25 @@ function AnnounceCountdown(int SecondsLeft) { } function CheckGameEnded() { + local Object TempDataDummy; + local VS_TempData TD; + if (GameState >= GS_GameEnded || Level.Game.bGameEnded == false) // mid-game voting or not ended yet return; - if (bIsMultiRound && Level.Game.GetPropertyText("bDontRestart") ~= "False") + if (bIsMultiRound && Level.Game.GetPropertyText("bDontRestart") ~= "False") { + if (bConfiguredTempData == false) { + TempDataDummy = new(none, 'VoteSysTemp') class'Object'; + TD = new(TempDataDummy, 'Data') class'VS_TempData'; + + TD.bNoColdStart = true; + TD.SaveConfig(); + + bConfiguredTempData = true; + } return; + } GameState = GS_GameEnded; TimeCounter = Settings.GameEndedVoteDelay;