made decision to remove checkmaprestrictions as it just annoys people because they dont understand why their nominations suddenly are removed
This commit is contained in:
parent
04ab4f9602
commit
714dbe9571
@ -617,12 +617,6 @@ public void OnClientPutInServer(int client)
|
||||
{
|
||||
ClearArray(g_NominateList[client]);
|
||||
}
|
||||
CheckMapRestrictions(true, true); //when creating a mapvote its anyways respecting the time restrictions so we should also just respect them here already
|
||||
}
|
||||
|
||||
public void OnClientDisconnect_Post(int client)
|
||||
{
|
||||
CheckMapRestrictions(true, true); //when creating a mapvote its anyways respecting the time restrictions so we should also just respect them here already
|
||||
}
|
||||
|
||||
public void OnClientDisconnect(int client)
|
||||
@ -1173,8 +1167,6 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CheckMapRestrictions(true, true);
|
||||
CreateNextVote();
|
||||
|
||||
g_ChangeTime = when;
|
||||
@ -2242,11 +2234,6 @@ public int Native_GetNominatedMapList(Handle plugin, int numParams)
|
||||
return 0;
|
||||
|
||||
static char map[PLATFORM_MAX_PATH];
|
||||
CheckMapRestrictions(true, true);
|
||||
/*
|
||||
when a guy checks the nomlist the only thing that has changed is the time.
|
||||
Its not smart to display a map in the nominate list just for Initiate Vote() to discard it anyways from the map vote just because of time based restriction
|
||||
*/
|
||||
for (int client = 0; client < MaxClients; client++)
|
||||
{
|
||||
for(int i = 0; i < GetArraySize(g_NominateList[client]); i++)
|
||||
@ -2807,79 +2794,6 @@ stock int InternalGetMapCooldownTime(const char[] map)
|
||||
return Cooldown;
|
||||
}
|
||||
|
||||
void CheckMapRestrictions(bool time = false, bool players = false)
|
||||
{
|
||||
if(!InternalAreRestrictionsActive())
|
||||
return;
|
||||
|
||||
static char map[PLATFORM_MAX_PATH];
|
||||
|
||||
for (int client = 0; client < MaxClients; client++)
|
||||
{
|
||||
if(CheckCommandAccess(client, "sm_nominate_ignore", ADMFLAG_CHEATS, true))
|
||||
continue;
|
||||
for (int i = 0; i < GetArraySize(g_NominateList[client]); i++)
|
||||
{
|
||||
bool remove;
|
||||
GetArrayString(g_NominateList[client], i, map, PLATFORM_MAX_PATH);
|
||||
|
||||
if (time)
|
||||
{
|
||||
int TimeRestriction = InternalGetMapTimeRestriction(map);
|
||||
if(TimeRestriction)
|
||||
{
|
||||
remove = true;
|
||||
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
{
|
||||
CPrintToChat(client, "[MCE] %t", "Nomination Removed Time Error", map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (players)
|
||||
{
|
||||
int PlayerRestriction = InternalGetMapPlayerRestriction(map);
|
||||
if(PlayerRestriction)
|
||||
{
|
||||
remove = true;
|
||||
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
{
|
||||
if(PlayerRestriction < 0)
|
||||
CPrintToChat(client, "[MCE] %t", "Nomination Removed MinPlayers Error", map);
|
||||
else
|
||||
CPrintToChat(client, "[MCE] %t", "Nomination Removed MaxPlayers Error", map);
|
||||
}
|
||||
}
|
||||
if (InternalGetAveragePlayerHourRestriction(map) > 0 && !remove)
|
||||
{
|
||||
remove = true;
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
{
|
||||
ReplyToCommand(client, "[MCE] Your nomination %s has been removed because it does not meet the minimum Average hour requirements.", map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (remove)
|
||||
{
|
||||
if (strlen(map) > 0)
|
||||
{
|
||||
Call_StartForward(g_NominationsResetForward);
|
||||
Call_PushString(map);
|
||||
Call_PushCell(client);
|
||||
Call_Finish();
|
||||
}
|
||||
|
||||
RemoveFromArray(g_NominateList[client], i);
|
||||
RemoveFromArray(g_NominateOwners, i);
|
||||
g_NominateCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stock int InternalGetMapMinTime(const char[] map)
|
||||
{
|
||||
int MinTime = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user