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);
|
||||||
@ -671,28 +678,34 @@ public void OnClientDisconnect(int client)
|
|||||||
|
|
||||||
public Action Command_SetNextmap(int client, int args)
|
public Action Command_SetNextmap(int client, int args)
|
||||||
{
|
{
|
||||||
if(args < 1)
|
if(args < 1)
|
||||||
{
|
{
|
||||||
CReplyToCommand(client, "[MCE] Usage: sm_setnextmap <map>");
|
CReplyToCommand(client, "[MCE] Usage: sm_setnextmap <map>");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
GetCmdArg(1, map, PLATFORM_MAX_PATH);
|
GetCmdArg(1, map, PLATFORM_MAX_PATH);
|
||||||
|
|
||||||
if(!IsMapValid(map))
|
if(!IsMapValid(map))
|
||||||
{
|
{
|
||||||
CReplyToCommand(client, "[MCE] %t", "Map was not found", map);
|
CReplyToCommand(client, "[MCE] %t", "Map was not found", map);
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowActivity(client, "%t", "Changed Next Map", map);
|
ShowActivity(client, "%t", "Changed Next Map", map);
|
||||||
LogAction(client, -1, "\"%L\" changed nextmap to \"%s\"", client, map);
|
LogAction(client, -1, "\"%L\" changed nextmap to \"%s\"", client, map);
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action Command_ReloadMaps(int client, int args)
|
public Action Command_ReloadMaps(int client, int args)
|
||||||
|
Loading…
Reference in New Issue
Block a user