mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
make Shavit_HijackAngles calculate the number of ticks
This commit is contained in:
parent
7493c7d548
commit
b09be9f5de
@ -1452,13 +1452,9 @@ void LoadCheckpointCache(int client, cp_cache_t cpcache, bool isPersistentData)
|
||||
{
|
||||
Shavit_SetPracticeMode(client, false, true);
|
||||
|
||||
float latency = GetClientLatency(client, NetFlow_Both);
|
||||
|
||||
if (gCV_ExperimentalSegmentedEyeAngleFix.BoolValue && latency > 0.0)
|
||||
if (gCV_ExperimentalSegmentedEyeAngleFix.BoolValue)
|
||||
{
|
||||
int ticks = RoundToCeil(latency / GetTickInterval()) + 1;
|
||||
//PrintToChat(client, "%f %f %d", latency, GetTickInterval(), ticks);
|
||||
Shavit_HijackAngles(client, cpcache.fAngles[0], cpcache.fAngles[1], ticks);
|
||||
Shavit_HijackAngles(client, cpcache.fAngles[0], cpcache.fAngles[1], -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -593,5 +593,23 @@ public int Native_HijackAngles(Handle handler, int numParams)
|
||||
|
||||
gF_HijackedAngles[client][0] = view_as<float>(GetNativeCell(2));
|
||||
gF_HijackedAngles[client][1] = view_as<float>(GetNativeCell(3));
|
||||
gI_HijackFrames[client] = GetNativeCell(4);
|
||||
|
||||
int ticks = GetNativeCell(4);
|
||||
|
||||
if (ticks == -1)
|
||||
{
|
||||
float latency = GetClientLatency(client, NetFlow_Both);
|
||||
|
||||
if (latency > 0.0)
|
||||
{
|
||||
ticks = RoundToCeil(latency / GetTickInterval()) + 1;
|
||||
//PrintToChat(client, "%f %f %d", latency, GetTickInterval(), ticks);
|
||||
gI_HijackFrames[client] = ticks;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gI_HijackFrames[client] = ticks;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user