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.z = -sp;
forward = forward * meleeRange + head; forward = forward * meleeRange + head;
Vector hit;
// Check if we our line is within the targets hitbox // 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 true;
return false; return false;
} }

View File

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