slight change to targeting
This commit is contained in:
parent
a27f0fa888
commit
7f7bfb5e80
@ -681,6 +681,17 @@ public int GetClosestClient_option1(int targeteam, int client)
|
|||||||
{
|
{
|
||||||
float nearestdistance = -1.0;
|
float nearestdistance = -1.0;
|
||||||
int nearest = -1;
|
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 (!IsAbleToSee(client, i))
|
||||||
|
continue;
|
||||||
|
if (is_client_stuck_or_afk(i))
|
||||||
|
continue;
|
||||||
|
bot_alternative = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
for (int i = 1; i <= MaxClients; i++)
|
for (int i = 1; i <= MaxClients; i++)
|
||||||
if (IsValidClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == targeteam && i != client)
|
if (IsValidClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == targeteam && i != client)
|
||||||
{
|
{
|
||||||
@ -698,6 +709,8 @@ public int GetClosestClient_option1(int targeteam, int client)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (bot_alternative && is_bot_player(i))
|
||||||
|
continue;
|
||||||
if (i == targethuman[client])
|
if (i == targethuman[client])
|
||||||
return targethuman[client];
|
return targethuman[client];
|
||||||
float pos[3];
|
float pos[3];
|
||||||
|
Loading…
Reference in New Issue
Block a user