From d74cb89848974eb706bd35c7ffc5c8b19ea6ea29 Mon Sep 17 00:00:00 2001 From: BotoX Date: Fri, 4 Oct 2019 11:23:05 +0200 Subject: [PATCH] LagCompensation: block player from touching hooked trigger --- LagCompensation/scripting/LagCompensation.sp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/LagCompensation/scripting/LagCompensation.sp b/LagCompensation/scripting/LagCompensation.sp index ae598b6..51f5d20 100644 --- a/LagCompensation/scripting/LagCompensation.sp +++ b/LagCompensation/scripting/LagCompensation.sp @@ -149,6 +149,10 @@ public void OnPluginStart() public void OnPluginEnd() { + FilterSolidMoved(g_bNoPhysics, 0); + + DHookDisableDetour(g_hUTIL_Remove, false, Detour_OnUTIL_Remove); + for(int i = 0; i < g_iNumEntities; i++) { if(!IsValidEntity(g_aEntityLagData[i].iEntity)) @@ -291,6 +295,8 @@ public void OnRunThinkFunctions(bool simulating) ); #endif } + + FilterSolidMoved(g_bNoPhysics, sizeof(g_bNoPhysics)); } public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) @@ -314,10 +320,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 { int simtick = GetGameTickCount() - delta; if(simtick > g_aEntityLagData[i].iDeleted) - { - // TODO: completly block player from touching trigger continue; - } } int iRecordIndex = g_aEntityLagData[i].iRecordIndex - delta; @@ -325,7 +328,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 iRecordIndex += MAX_RECORDS; RestoreEntityFromRecord(g_aEntityLagData[i].iEntity, client, g_aaLagRecords[i][iRecordIndex]); - g_aEntityLagData[i].bRestore = true;//!g_aEntityLagData[i].iDeleted; + g_aEntityLagData[i].bRestore = !g_aEntityLagData[i].iDeleted; #if defined DEBUG LogMessage("2 [%d] index %d, Entity %d -> delta = %d | Record = %d", GetGameTickCount(), i, g_aEntityLagData[i].iEntity, delta, iRecordIndex); @@ -342,6 +345,8 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 public void OnPostPlayerThinkFunctions() { + FilterSolidMoved(g_bNoPhysics, 0); + for(int i = 0; i < g_iNumEntities; i++) { if(!g_aEntityLagData[i].bRestore)