this should now catch the player count correctly to set the cooldown and shared cooldowns
This commit is contained in:
parent
ef537b8826
commit
ff012d2df5
@ -143,7 +143,6 @@ int g_iNextmapState = 0; //0 = nothing. 1 = rtv succesfull. 2 = admin used setne
|
|||||||
int g_mapFileSerial = -1;
|
int g_mapFileSerial = -1;
|
||||||
int g_iSkipAllRestrictions;
|
int g_iSkipAllRestrictions;
|
||||||
int g_iDontCooldownMap;
|
int g_iDontCooldownMap;
|
||||||
int g_iClientCount;
|
|
||||||
int g_iMapsFromCasualPool;
|
int g_iMapsFromCasualPool;
|
||||||
|
|
||||||
|
|
||||||
@ -249,7 +248,6 @@ public void OnPluginEnd()
|
|||||||
|
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
g_iClientCount = 0;
|
|
||||||
LoadTranslations("mapchooser_extended.phrases");
|
LoadTranslations("mapchooser_extended.phrases");
|
||||||
LoadTranslations("basevotes.phrases");
|
LoadTranslations("basevotes.phrases");
|
||||||
LoadTranslations("common.phrases");
|
LoadTranslations("common.phrases");
|
||||||
@ -552,19 +550,6 @@ public void OnMapStart()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_Config.Rewind();
|
g_Config.Rewind();
|
||||||
|
|
||||||
if (g_iDontCooldownMap < g_iClientCount)
|
|
||||||
{
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
|
||||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
|
||||||
int Cooldown = InternalGetMapCooldown(map);
|
|
||||||
g_OldMapList.SetValue(map, Cooldown, true);
|
|
||||||
|
|
||||||
Cooldown = GetTime() + InternalGetMapCooldownTime(map) - RoundToFloor(GetGameTime());
|
|
||||||
g_TimeMapList.SetValue(map, Cooldown, true);
|
|
||||||
//2026 march 18th: set cooldown on all maps that share a cooldown with this one including itself.
|
|
||||||
SetSharedCooldowns(map);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnConfigsExecuted()
|
public void OnConfigsExecuted()
|
||||||
@ -671,22 +656,9 @@ public void OnMapEnd()
|
|||||||
g_WarningTimer = INVALID_HANDLE;
|
g_WarningTimer = INVALID_HANDLE;
|
||||||
g_RunoffCount = 0;
|
g_RunoffCount = 0;
|
||||||
|
|
||||||
g_iClientCount = GetClientCount(false);
|
|
||||||
if (g_iDontCooldownMap < g_iClientCount)
|
|
||||||
{
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
int Cooldown;
|
|
||||||
|
|
||||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||||
Cooldown = InternalGetMapCooldown(map);
|
int Cooldown = InternalGetMapCooldown(map);
|
||||||
g_OldMapList.SetValue(map, Cooldown, true);
|
|
||||||
|
|
||||||
Cooldown = GetTime() + InternalGetMapCooldownTime(map) - RoundToFloor(GetGameTime());
|
|
||||||
g_TimeMapList.SetValue(map, Cooldown, true);
|
|
||||||
|
|
||||||
//2026 march 18th: set cooldown on all maps that share cooldown with this one.
|
|
||||||
//why do it again? because obviously people will make the mistake of giving the map its own specific cooldown despite being part of a sharedcooldown group.
|
|
||||||
SetSharedCooldowns(map);
|
|
||||||
|
|
||||||
StringMapSnapshot OldMapListSnapshot = g_OldMapList.Snapshot();
|
StringMapSnapshot OldMapListSnapshot = g_OldMapList.Snapshot();
|
||||||
for(int i = 0; i < OldMapListSnapshot.Length; i++)
|
for(int i = 0; i < OldMapListSnapshot.Length; i++)
|
||||||
@ -703,6 +675,8 @@ public void OnMapEnd()
|
|||||||
delete OldMapListSnapshot;
|
delete OldMapListSnapshot;
|
||||||
|
|
||||||
StringMapSnapshot TimeMapListSnapshot = g_TimeMapList.Snapshot();
|
StringMapSnapshot TimeMapListSnapshot = g_TimeMapList.Snapshot();
|
||||||
|
|
||||||
|
Cooldown = GetTime() + InternalGetMapCooldownTime(map) - RoundToFloor(GetGameTime());
|
||||||
for(int i = 0; i < TimeMapListSnapshot.Length; i++)
|
for(int i = 0; i < TimeMapListSnapshot.Length; i++)
|
||||||
{
|
{
|
||||||
TimeMapListSnapshot.GetKey(i, map, sizeof(map));
|
TimeMapListSnapshot.GetKey(i, map, sizeof(map));
|
||||||
@ -716,7 +690,6 @@ public void OnMapEnd()
|
|||||||
|
|
||||||
InternalStoreMapCooldowns();
|
InternalStoreMapCooldowns();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void OnClientPutInServer(int client)
|
public void OnClientPutInServer(int client)
|
||||||
{
|
{
|
||||||
@ -1009,6 +982,20 @@ public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason)
|
|||||||
//0 timeleft and all extends used or map was not extended. (we do the map vote at map end)
|
//0 timeleft and all extends used or map was not extended. (we do the map vote at map end)
|
||||||
//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.
|
||||||
|
if (GetClientCount(false) > g_iDontCooldownMap)
|
||||||
|
{
|
||||||
|
static char map[PLATFORM_MAX_PATH];
|
||||||
|
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||||
|
int Cooldown = InternalGetMapCooldown(map);
|
||||||
|
g_OldMapList.SetValue(map, Cooldown, true);
|
||||||
|
|
||||||
|
Cooldown = GetTime() + InternalGetMapCooldownTime(map) - RoundToFloor(GetGameTime());
|
||||||
|
g_TimeMapList.SetValue(map, Cooldown, true);
|
||||||
|
//2026 march 18th: set cooldown on all maps that share a cooldown with this one including itself.
|
||||||
|
SetSharedCooldowns(map);
|
||||||
|
}
|
||||||
|
|
||||||
if (timeleft <= 0 && g_RtvInitiated && g_iNextmapState < 4) //last round was terminated, rtv is going on and we did not set g_i Nextmapstate yet.
|
if (timeleft <= 0 && g_RtvInitiated && g_iNextmapState < 4) //last round was terminated, rtv is going on and we did not set g_i Nextmapstate yet.
|
||||||
{
|
{
|
||||||
//extra time in case of rtv, rtv run-off (there is no dont change option here as we already used all extends or people voted dont extend)
|
//extra time in case of rtv, rtv run-off (there is no dont change option here as we already used all extends or people voted dont extend)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user