removed bot targeting humans when zm as requested by admin team

This commit is contained in:
Christian 2020-10-24 23:07:38 +02:00
parent 20c19c925f
commit 6e665609ec

View File

@ -217,7 +217,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
if (client == present)
{
int flags = GetEntityFlags(client);
if (!(flags & FL_ONGROUND) && (flags_old & FL_ONGROUND) && !(buttons_old & IN_JUMP) && !(buttons & IN_JUMP))
if (!(flags & FL_ONGROUND) && (flags_old & FL_ONGROUND) && !(buttons_old & IN_JUMP) && !(buttons & IN_JUMP) && (GetEntityMoveType(present) != MOVETYPE_LADDER))
{
float Vel[3], feet_origin[3], ground_pos[3], downwards[3];
//TODO
@ -229,7 +229,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
downwards[0] = 90.0;
downwards[1] = 0.0;
downwards[2] = 0.0;
TR_TraceRayFilter(feet_origin, downwards, MASK_PLAYERSOLID, RayType_Infinite, TraceRayDontHitSelf, present);
TR_TraceRayFilter(feet_origin, downwards, MASK_ALL, RayType_Infinite, TraceRayDontHitSelf, present);
if (TR_DidHit())
{
TR_GetEndPosition(ground_pos);
@ -240,7 +240,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
float angles_eye[3];
GetClientEyeAngles(present, angles_eye);
feet_origin[2] += 10.0;
TR_TraceRayFilter(feet_origin, angles_eye, MASK_PLAYERSOLID, RayType_Infinite, TraceRayDontHitSelf, present);
TR_TraceRayFilter(feet_origin, angles_eye, MASK_ALL, RayType_Infinite, TraceRayDontHitSelf, present);
if (TR_DidHit())
{
TR_GetEndPosition(ground_pos);
@ -254,6 +254,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
GetClientAbsOrigin(present, feet_origin_pre);
GetClientAbsOrigin(targethuman, human_feet_origin);
//target human is below, get down to them
//TODO maybe?
if (feet_origin_pre[2] - 200 > human_feet_origin[2])
{
buttons_old = buttons;
@ -261,13 +262,12 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float
return;
}
}
float angles_abs[3];
GetClientAbsAngles(present, angles_abs);
if (angles_abs[1] < 0)
angles_abs[1] += 180.0;
else
angles_abs[1] -= 180.0;
TeleportEntity(present, NULL_VECTOR, angles_abs, NULL_VECTOR);
float velocity[3];
GetEntPropVector(present, Prop_Data, "m_vecVelocity", velocity);
velocity[2] += 30.0;
NegateVector(velocity);
for (int y = 0; y < 10; y++)
TeleportEntity(present, NULL_VECTOR, NULL_VECTOR, velocity);
}
}
}
@ -315,7 +315,7 @@ public Action recursive_pressing(Handle timer, any data)
reset_target_human_tp_coord();
return Plugin_Continue;
}
target_enemy = GetClosestClient_option1(targeteam == 2 ? 3 : 2);
//target_enemy = GetClosestClient_option1(targeteam == 2 ? 3 : 2);
targethuman = GetClosestClient_option1(targeteam == 2 ? 2 : 3);
float enemy_distance = -1.0;
float dist_target = -1.0;
@ -325,11 +325,13 @@ public Action recursive_pressing(Handle timer, any data)
GetEntPropVector(targethuman, Prop_Send, "m_vecOrigin", pos);
dist_target = get_power_distance(present, pos);
}
/*
if (IsValidClient(target_enemy))
{
GetEntPropVector(target_enemy, Prop_Send, "m_vecOrigin", pos);
enemy_distance = get_power_distance(present, pos);
}
*/
if ((0 < enemy_distance && targeteam == 2) || dist_target < 0 < enemy_distance)
{
float feet_origin[3], enemy_feet_origin[3];
@ -377,7 +379,7 @@ public void trace_hulling_bot()
}
//acts as full body check
feet_origin[2] += BOUNDINGBOX_INFLATION_OFFSET;
TR_TraceHullFilter(feet_origin, feet_origin, mins, maxs, MASK_SOLID, TraceRayDontHitSelf);
TR_TraceHullFilter(feet_origin, feet_origin, mins, maxs, MASK_ALL, TraceRayDontHitSelf);
if (TR_DidHit())
{
//check 0.0 to 48.0 units starting from feet
@ -464,7 +466,7 @@ public void check_bot_surfing()
vEndPos[0] = vPos[0];
vEndPos[1] = vPos[1];
vEndPos[2] = vPos[2] - FindConVar("sv_maxvelocity").FloatValue;
TR_TraceHullFilter(vPos, vEndPos, vMins, vMaxs, MASK_PLAYERSOLID_BRUSHONLY, TraceRayDontHitSelf, present);
TR_TraceHullFilter(vPos, vEndPos, vMins, vMaxs, MASK_ALL, TraceRayDontHitSelf, present);
if (TR_DidHit())
{
//< 0.7 = surf ramp
@ -724,7 +726,7 @@ public bool Filter_NoPlayers(int entity, int mask)
public bool IsPointVisible(const float start[3], const float end[3])
{
TR_TraceRayFilter(start, end, MASK_SOLID, RayType_EndPoint, Filter_NoPlayers);
TR_TraceRayFilter(start, end, MASK_ALL, RayType_EndPoint, Filter_NoPlayers);
return TR_GetFraction() == 1.0;
}