preventing first map after server crash/restart to go on cooldown
This commit is contained in:
parent
8b6f2e0d96
commit
61568dc032
@ -188,6 +188,8 @@ int g_mapOfficialFileSerial = -1;
|
|||||||
char g_GameModName[64];
|
char g_GameModName[64];
|
||||||
bool g_WarningInProgress = false;
|
bool g_WarningInProgress = false;
|
||||||
bool g_AddNoVote = false;
|
bool g_AddNoVote = false;
|
||||||
|
//prevent first map after server crash from going on cooldown.
|
||||||
|
bool g_first_map_no_cooldown = false;
|
||||||
|
|
||||||
RoundCounting g_RoundCounting = RoundCounting_Standard;
|
RoundCounting g_RoundCounting = RoundCounting_Standard;
|
||||||
|
|
||||||
@ -421,6 +423,7 @@ public void OnPluginStart()
|
|||||||
|
|
||||||
InternalRestoreMapCooldowns();
|
InternalRestoreMapCooldowns();
|
||||||
|
|
||||||
|
g_first_map_no_cooldown = true;
|
||||||
|
|
||||||
int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10;
|
int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10;
|
||||||
ServerCommand("sm_cvar mp_chattime %i", total_time); //prevents map switching supposedly.
|
ServerCommand("sm_cvar mp_chattime %i", total_time); //prevents map switching supposedly.
|
||||||
@ -630,6 +633,7 @@ public void SetSharedCooldowns(char[] map)
|
|||||||
|
|
||||||
public void OnMapEnd()
|
public void OnMapEnd()
|
||||||
{
|
{
|
||||||
|
g_first_map_no_cooldown = false;
|
||||||
g_iNextmapState = 0;
|
g_iNextmapState = 0;
|
||||||
g_RtvInitiated = false;
|
g_RtvInitiated = false;
|
||||||
int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10;
|
int total_time = (GetConVarInt(g_Cvar_VoteDuration) * 2) + GetConVarInt(g_Cvar_RunOffWarningTime) + 10;
|
||||||
@ -969,7 +973,7 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason)
|
|||||||
//0 timeleft and rtv is ongoing still
|
//0 timeleft and rtv is ongoing still
|
||||||
|
|
||||||
//yeah sure why not just do it on every round end anyways.
|
//yeah sure why not just do it on every round end anyways.
|
||||||
if (GetClientCount(false) > g_iDontCooldownMap)
|
if (GetClientCount(false) > g_iDontCooldownMap && !g_first_map_no_cooldown)
|
||||||
{
|
{
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user