added priority less afk restrictions
This commit is contained in:
parent
27615bdb1a
commit
54d911dd32
@ -448,6 +448,7 @@ stock bool is_client_stuck_or_afk(int client)
|
||||
return client_own_distance < min_distance_cap;
|
||||
}
|
||||
|
||||
int target_human_afk_counter = 0;
|
||||
public int GetClosestClient_option1(int targeteam)
|
||||
{
|
||||
float nearestdistance = -1.0;
|
||||
@ -458,7 +459,18 @@ public int GetClosestClient_option1(int targeteam)
|
||||
if (!IsAbleToSee(present, i))
|
||||
continue;
|
||||
if (is_client_stuck_or_afk(i))
|
||||
continue;
|
||||
{
|
||||
if (i != targethuman)
|
||||
continue;
|
||||
target_human_afk_counter++;
|
||||
if (target_human_afk_counter > 5)
|
||||
{
|
||||
target_human_afk_counter = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
target_human_afk_counter = 0;
|
||||
float pos[3];
|
||||
GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
|
||||
float dist_target = get_power_distance(present, pos);
|
||||
|
Loading…
Reference in New Issue
Block a user