diff --git a/AutismBotIngame/scripting/autism_bot_info.sp b/AutismBotIngame/scripting/autism_bot_info.sp index 8b9bd3bd..91b994b4 100644 --- a/AutismBotIngame/scripting/autism_bot_info.sp +++ b/AutismBotIngame/scripting/autism_bot_info.sp @@ -20,7 +20,6 @@ int buttons_old[MAXPLAYERS + 1]; int flags_old[MAXPLAYERS + 1]; int ports[7] = {48470, 48471, 48472, 48473, 48474, 48479, 48480}; //last three indexes are ports its sending udp from in plugin int server_ports[2] = {27015, 27035}; //server ports: ze, ze2 -bool surf_cooldown = false; int bot_avoid_edge[MAXPLAYERS + 1]; float client_old_coords[MAXPLAYERS + 1][3]; float targethuman_teleported[MAXPLAYERS + 1][3]; @@ -785,12 +784,6 @@ public void trace_hulling_bot(int client) } } -public Action surf_cooldown_timer(Handle timer, any data) -{ - surf_cooldown = false; - return Plugin_Continue; -} - public bool TraceRayDontHitSelf(int entity, int mask, any data) { return entity != data && !(0 < entity <= MaxClients); @@ -826,15 +819,19 @@ stock bool IsValidClient(int client) stock bool is_client_stuck_or_afk(int client, int i) { - //can trigger between 6-8 times per second + //triggers between 6-8 times per second target_friend_afk_counter[client][i]++; - if (target_friend_afk_counter[client][i] > 24) + if (target_friend_afk_counter[client][i] >= 24) { - target_friend_afk_counter[client][i] = 0; float min_distance_cap = 1.0; - float client_own_distance = get_power_distance(client, client_old_coords[client]); - GetEntPropVector(client, Prop_Send, "m_vecOrigin", client_old_coords[client]); - return client_own_distance < min_distance_cap; + float i_own_distance = get_power_distance(i, client_old_coords[i]); + GetEntPropVector(i, Prop_Send, "m_vecOrigin", client_old_coords[i]); + bool not_moved = i_own_distance < min_distance_cap; + if (!not_moved) + { + target_friend_afk_counter[client][i] = 0; + } + return not_moved; } return false; }