Disable latency when backtrack disabled

This commit is contained in:
TotallyNotElite 2018-08-11 18:30:50 +02:00
parent 77dcc3d44f
commit 2fa43fe72f
2 changed files with 5 additions and 2 deletions

View File

@ -104,8 +104,9 @@ bool unifiedCanBackstab(Vector &vecAngle, Vector min, Vector max,
forward.z = -sp;
forward = forward * meleeRange + head;
Vector hit;
// Check if we our line is within the targets hitbox
if (LineIntersectsBox(minz, maxz, head, forward))
if (hacks::shared::triggerbot::CheckLineBox(minz, maxz, head, forward, hit))
return true;
return false;
}

View File

@ -27,7 +27,7 @@ bool shouldBacktrack();
BacktrackData headPositions[32][66]{};
int highesttick[32]{};
int lastincomingsequencenumber = 0;
bool isBacktrackEnabled;
bool isBacktrackEnabled = false;
circular_buf sequences{ 2048 };
void UpdateIncomingSequences()
@ -50,6 +50,8 @@ void UpdateIncomingSequences()
}
void AddLatencyToNetchan(INetChannel *ch, float Latency)
{
if (!isBacktrackEnabled)
return;
if (Latency > 200.0f)
Latency -= ch->GetLatency(MAX_FLOWS);
for (auto &seq : sequences)