further small changes to targeting

This commit is contained in:
christian 2021-04-10 09:57:45 +02:00
parent 7f7bfb5e80
commit b195c60ad7

View File

@ -683,7 +683,7 @@ public int GetClosestClient_option1(int targeteam, int client)
int nearest = -1;
bool bot_alternative = false;
for (int i = 1; i <= MaxClients; i++)
if (IsValidClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == targeteam && !(is_bot_player(i)))
if (IsValidClient(i) && IsPlayerAlive(i) && !is_bot_player(i))
{
if (!IsAbleToSee(client, i))
continue;
@ -709,7 +709,7 @@ public int GetClosestClient_option1(int targeteam, int client)
continue;
}
}
if (bot_alternative && is_bot_player(i))
if (bot_alternative && targethuman[client] == i && is_bot_player(i))
continue;
if (i == targethuman[client])
return targethuman[client];