small updates

This commit is contained in:
christian 2021-04-20 19:31:43 +02:00
parent 5ee4993df9
commit c3c03f4e95

View File

@ -233,7 +233,7 @@ public Action bot_check_connect(Handle timer, any data)
for (int i = 1; i <= MaxClients; i++)
if (IsValidClient(i) && !IsFakeClient(i))
{
if (client_count > 61)
if (client_count > 60)
{
found_bot_1 = true;
found_bot_2 = true;
@ -276,7 +276,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
if (is_bot_player(client))
{
int flags = GetEntityFlags(client);
if (!(flags & FL_ONGROUND) && (flags_old[client] & FL_ONGROUND) && !(buttons_old[client] & IN_JUMP) && !(buttons & IN_JUMP) && (GetEntityMoveType(client) != MOVETYPE_LADDER))
if (!(flags & FL_ONGROUND) && (flags_old[client] & FL_ONGROUND) && !(buttons_old[client] & IN_JUMP) && !(buttons & IN_JUMP) && (GetEntityMoveType(client) != MOVETYPE_LADDER) && GetEntProp(client, Prop_Data, "m_nWaterLevel") == 0)
{
float Vel[3], feet_origin[3], ground_pos[3], downwards[3];
//TODO
@ -421,6 +421,7 @@ public Action recursive_pressing(Handle timer, any data)
}
else if (IsValidClient(targethuman[client]))
face_call(targethuman[client], client);
if (GetEntProp(client, Prop_Data, "m_nWaterLevel") == 0)
trace_hulling_bot(client);
char message[generic_length * 7];
if (IsValidClient(targethuman[client]))
@ -700,8 +701,6 @@ public int GetClosestClient_option1(int targeteam, int client)
continue;
}
}
if (i == targethuman[client] && !is_bot_player(i))
return targethuman[client];
float pos[3];
GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
float dist_target = get_power_distance(client, pos);
@ -709,11 +708,29 @@ public int GetClosestClient_option1(int targeteam, int client)
dist_target += 7500;
else if (admins[i] || vips[i] || i == target_enemy[client])
dist_target /= 5;
if (i == targethuman[client])
dist_target /= 5;
if (nearestdistance < 0 || dist_target < nearestdistance)
{
nearest = i;
nearestdistance = dist_target;
}
}
if (nearest == -1)
{
for (int i = 1; i <= MaxClients; i++)
if (IsValidClient(i) && IsPlayerAlive(i) && i != client && GetClientTeam(i) == targeteam)
{
float pos[3];
GetEntPropVector(i, Prop_Send, "m_vecOrigin", pos);
float dist_target = get_power_distance(client, pos);
if (nearestdistance < 0 || dist_target < nearestdistance)
{
nearest = i;
nearestdistance = dist_target;
}
}
}
return nearest;
}