LagCompensation: fix more bugs, broke minas nazguls though

This commit is contained in:
BotoX 2019-10-24 00:10:29 +02:00
parent 9b22f87169
commit 0b3ce53390
1 changed files with 9 additions and 10 deletions

View File

@ -364,7 +364,7 @@ public void OnRunThinkFunctions(bool simulating)
if(g_aEntityLagData[i].iDeleted) if(g_aEntityLagData[i].iDeleted)
{ {
if(g_aEntityLagData[i].iDeleted + MAX_RECORDS < GetGameTickCount()) if(g_aEntityLagData[i].iDeleted + MAX_RECORDS <= GetGameTickCount())
{ {
PrintToBoth("[%d] !!!!!!!!!!! RemoveEdict: %d / ent: %d", GetGameTickCount(), i, g_aEntityLagData[i].iEntity); PrintToBoth("[%d] !!!!!!!!!!! RemoveEdict: %d / ent: %d", GetGameTickCount(), i, g_aEntityLagData[i].iEntity);
// calls OnEntityDestroyed right away // calls OnEntityDestroyed right away
@ -413,7 +413,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
int iEntity = g_aEntityLagData[i].iEntity; int iEntity = g_aEntityLagData[i].iEntity;
// Entity too new, the client couldn't even see it yet. // Entity too new, the client couldn't even see it yet.
if(g_aEntityLagData[i].iSpawned < iPlayerSimTick) if(g_aEntityLagData[i].iSpawned > iPlayerSimTick)
{ {
g_aaBlockTouch[client][iEntity] = 1; g_aaBlockTouch[client][iEntity] = 1;
continue; continue;
@ -423,22 +423,21 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3
g_aaBlockTouch[client][iEntity] = 0; g_aaBlockTouch[client][iEntity] = 0;
} }
if(g_aEntityLagData[i].iNotMoving >= MAX_RECORDS)
continue;
if(iDelta >= g_aEntityLagData[i].iNumRecords)
iDelta = g_aEntityLagData[i].iNumRecords - 1;
if(g_aEntityLagData[i].iDeleted) if(g_aEntityLagData[i].iDeleted)
{ {
int iEntitySimTick = iGameTick - iDelta; if(g_aEntityLagData[i].iDeleted <= iPlayerSimTick)
if(iEntitySimTick > g_aEntityLagData[i].iDeleted)
{ {
g_aaBlockTouch[client][iEntity] = 1; g_aaBlockTouch[client][iEntity] = 1;
continue; continue;
} }
} }
if(g_aEntityLagData[i].iNotMoving >= MAX_RECORDS)
continue;
if(iDelta >= g_aEntityLagData[i].iNumRecords)
iDelta = g_aEntityLagData[i].iNumRecords - 1;
int iRecordIndex = g_aEntityLagData[i].iRecordIndex - iDelta; int iRecordIndex = g_aEntityLagData[i].iRecordIndex - iDelta;
if(iRecordIndex < 0) if(iRecordIndex < 0)
iRecordIndex += MAX_RECORDS; iRecordIndex += MAX_RECORDS;