Skip to content

Commit

Permalink
Fix Multi-Rounds Detected As Crashes (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Jan 1, 2024
1 parent 490ebf3 commit bf93801
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Classes/MutVoteSys.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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<CriticalEventPlus> TimeMessageClass;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bf93801

Please sign in to comment.