handling rare case where cprint tries to send message to disconnected player

This commit is contained in:
jenz 2023-03-12 19:42:12 +01:00
parent 1b2d2e48ff
commit de2dbcb9c5

View File

@ -1019,7 +1019,7 @@ public Handle get_most_nominated_maps()
int nominate_count_for_particular_map = 0;
sm.GetValue(map_iteration, nominate_count_for_particular_map);
nominate_count_for_particular_map++;
//if i is 0 its admin nominated map that must come into the vote
//if i is 0 its admin nominated map that most come into the vote
if(!i)
{
nominate_count_for_particular_map = 999;
@ -2588,8 +2588,11 @@ void CheckMapRestrictions(bool time = false, bool players = false)
if(TimeRestriction)
{
remove = true;
CPrintToChat(client, "[MCE] %t", "Nomination Removed Time Error", map);
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
{
CPrintToChat(client, "[MCE] %t", "Nomination Removed Time Error", map);
}
}
}
@ -2600,10 +2603,13 @@ void CheckMapRestrictions(bool time = false, bool players = false)
{
remove = true;
if(PlayerRestriction < 0)
CPrintToChat(client, "[MCE] %t", "Nomination Removed MinPlayers Error", map);
else
CPrintToChat(client, "[MCE] %t", "Nomination Removed MaxPlayers Error", map);
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);
}
}
}