okay so mapend also did not detect it just like mapstart. right after the vote is however a fitting point to set the bol
This commit is contained in:
parent
af83da6f34
commit
56f6ac7e38
@ -140,6 +140,7 @@ bool g_MapVoteCompleted;
|
|||||||
bool g_ChangeMapAtRoundEnd;
|
bool g_ChangeMapAtRoundEnd;
|
||||||
bool g_ChangeMapInProgress;
|
bool g_ChangeMapInProgress;
|
||||||
bool g_HasIntermissionStarted = false;
|
bool g_HasIntermissionStarted = false;
|
||||||
|
bool g_SaveCDOnMapEnd = true;
|
||||||
int g_mapFileSerial = -1;
|
int g_mapFileSerial = -1;
|
||||||
int g_iPlayerCount_excludeSpec;
|
int g_iPlayerCount_excludeSpec;
|
||||||
int g_iPlayerAFKTime;
|
int g_iPlayerAFKTime;
|
||||||
@ -524,6 +525,12 @@ public void OnMapStart()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
g_Config.Rewind();
|
g_Config.Rewind();
|
||||||
|
//this does not detect obvioulsy when there is more or less than 15 players active because its the mapstart
|
||||||
|
// nobody has connected yet. OnMapEnd also does not work for checking this. so no point setting it to false here.
|
||||||
|
if(InternalAreRestrictionsActive(true))
|
||||||
|
g_SaveCDOnMapEnd = true;
|
||||||
|
else
|
||||||
|
g_SaveCDOnMapEnd = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnConfigsExecuted()
|
public void OnConfigsExecuted()
|
||||||
@ -592,7 +599,7 @@ public void OnMapEnd()
|
|||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
int Cooldown;
|
int Cooldown;
|
||||||
|
|
||||||
if(InternalAreRestrictionsActive(false))
|
if(g_SaveCDOnMapEnd)
|
||||||
{
|
{
|
||||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||||
Cooldown = InternalGetMapCooldown(map);
|
Cooldown = InternalGetMapCooldown(map);
|
||||||
@ -691,6 +698,12 @@ public Action Command_SetNextmap(int client, int args)
|
|||||||
|
|
||||||
SetNextMap(map);
|
SetNextMap(map);
|
||||||
g_MapVoteCompleted = true;
|
g_MapVoteCompleted = true;
|
||||||
|
//checking on MapStart and MapEnd is not good enough. Players are not considered alive and on teams at those points in time.
|
||||||
|
//therefore instead applying the bool here after the mapvote completed.
|
||||||
|
if(InternalAreRestrictionsActive(false))
|
||||||
|
g_SaveCDOnMapEnd = true;
|
||||||
|
else
|
||||||
|
g_SaveCDOnMapEnd = false;
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user