Reset Variables when starting the mode

This commit is contained in:
Beu 2023-07-12 13:26:50 +02:00
parent 74dc086876
commit a3c7553f60
1 changed files with 18 additions and 0 deletions

View File

@ -164,6 +164,7 @@ UsePvECollisions = True;
StateMgr::ForcePlayersStates([StateMgr::C_State_Waiting]);
WarmUp::SetAvailability(True);
CarRank::Reset();
ResetNetworkVariables();
***
***Match_InitMap***
@ -552,6 +553,23 @@ if (Round_ForceEndRound || Round_SkipPauseRound) {
// Functions
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //
Void ResetNetworkVariables() {
declare netwrite Boolean Net_DisplayUI for Teams[0] = False;
Net_DisplayUI = False;
declare netwrite Integer Net_NBPlayers for Teams[0] = 0;
Net_NBPlayers = 0;
declare netwrite Integer Net_PlayersNbAlive for Teams[0] = 0;
Net_PlayersNbAlive = 0;
declare netwrite Integer Net_NextMalus for Teams[0] = -1;
Net_NextMalus = 0;
declare netwrite Integer Net_TimeBeforeMalus for Teams[0] = -1;
Net_TimeBeforeMalus = 0;
declare netwrite Integer Net_RoundsPerMap for Teams[0] = 0;
Net_RoundsPerMap = 0;
declare netwrite Integer Net_CurrentRoundNb for Teams[0] = 0;
Net_CurrentRoundNb = 0;
}
/** Get the Time Before the first Malus or NightMare Mode
*
* @param _StartTime The starting time of the map