FB: Autojump, AFK and canReachVector improvements

This commit is contained in:
TotallyNotElite 2018-07-21 11:49:44 +02:00
parent 5e05e151e8
commit 8d8b7a0e41
2 changed files with 4 additions and 4 deletions

View File

@ -76,7 +76,7 @@ void checkAFK()
auto entity = ENTITY(i);
if (CE_BAD(entity))
continue;
if (!CE_VECTOR(entity, netvar.vVelocity).IsZero(40.0f))
if (!CE_VECTOR(entity, netvar.vVelocity).IsZero(60.0f))
{
afkTicks[i].update();
}
@ -352,7 +352,7 @@ void WorldTick()
if (dist_to_target > (float) follow_distance)
{
// Check for jump
if (autojump && lastJump.check(1000) && (idle_time.check(2000) || DistanceToGround(breadcrumbs[0]) > 42))
if (autojump && lastJump.check(1000) && (idle_time.check(2000) || DistanceToGround({breadcrumbs[0].x,breadcrumbs[0].y,breadcrumbs[0].z + 5}) > 47))
{
g_pUserCmd->buttons |= IN_JUMP;
lastJump.update();

View File

@ -195,7 +195,7 @@ bool canReachVector(Vector loc, Vector dest)
// math to get the next vector 40.0f in the direction of dest
Vector vec = loc + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1);
if (DistanceToGround(vec) >= 45)
if (DistanceToGround({vec.x,vec.y,vec.z + 5}) >= 40)
return false;
for (int j = 0; j < 4; j++)
@ -233,7 +233,7 @@ bool canReachVector(Vector loc, Vector dest)
// check if the vector is too high above ground
// higher to avoid small false positives, player can jump 42 hu according to
// the tf2 wiki
if (DistanceToGround(loc) >= 45)
if (DistanceToGround({loc.x,loc.y,loc.z + 5}) >= 40)
return false;
// check if there is enough space arround the vector for a player to fit