ensuring no tripping on the ladder
This commit is contained in:
parent
6dfc400fbb
commit
c2f7bca490
@ -184,14 +184,6 @@ public Action recursive_pressing(Handle timer, any data)
|
|||||||
int target_enemy = find_closest_enemy(present, targeteam);
|
int target_enemy = find_closest_enemy(present, targeteam);
|
||||||
float enemy_cap = 2.5;
|
float enemy_cap = 2.5;
|
||||||
float enemy_distance = -1.0;
|
float enemy_distance = -1.0;
|
||||||
if (IsValidClient(target_enemy))
|
|
||||||
{
|
|
||||||
enemy_distance = get_power_distance(target_enemy, pos);
|
|
||||||
if (enemy_distance < enemy_cap)
|
|
||||||
faceclient(target_enemy);
|
|
||||||
}
|
|
||||||
if (enemy_distance == -1.0 || enemy_distance > enemy_cap)
|
|
||||||
faceclient(targethuman);
|
|
||||||
//check ladder = 0, water = 1, in air(surfing) = 2 TODO
|
//check ladder = 0, water = 1, in air(surfing) = 2 TODO
|
||||||
int bot_on_type = -1;
|
int bot_on_type = -1;
|
||||||
if (GetEntityMoveType(present) == MOVETYPE_LADDER)
|
if (GetEntityMoveType(present) == MOVETYPE_LADDER)
|
||||||
@ -199,7 +191,19 @@ public Action recursive_pressing(Handle timer, any data)
|
|||||||
int ilevel = GetEntProp(present, Prop_Data, "m_nWaterLevel");
|
int ilevel = GetEntProp(present, Prop_Data, "m_nWaterLevel");
|
||||||
if (ilevel >= 2)
|
if (ilevel >= 2)
|
||||||
bot_on_type = 1;
|
bot_on_type = 1;
|
||||||
bool bot_stuck = is_client_stuck_or_afk(present);
|
bool bot_stuck = false;
|
||||||
|
if (bot_on_type != 0 && bot_on_type != 2)
|
||||||
|
{
|
||||||
|
if (IsValidClient(target_enemy))
|
||||||
|
{
|
||||||
|
enemy_distance = get_power_distance(target_enemy, pos);
|
||||||
|
if (enemy_distance < enemy_cap)
|
||||||
|
faceclient(target_enemy);
|
||||||
|
}
|
||||||
|
if (enemy_distance == -1.0 || enemy_distance > enemy_cap)
|
||||||
|
faceclient(targethuman);
|
||||||
|
bot_stuck = is_client_stuck_or_afk(present);
|
||||||
|
}
|
||||||
Format(message, sizeof(message), "dist_target: %f targethuman: %N bot_on_type: %i enemy_distance: %f bot_stuck: %i", dist_target, targethuman, bot_on_type, enemy_distance, bot_stuck);
|
Format(message, sizeof(message), "dist_target: %f targethuman: %N bot_on_type: %i enemy_distance: %f bot_stuck: %i", dist_target, targethuman, bot_on_type, enemy_distance, bot_stuck);
|
||||||
send_socket_msg(message, strlen(message));
|
send_socket_msg(message, strlen(message));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user