LagCompensation: block player from touching hooked trigger
This commit is contained in:
		
							parent
							
								
									0555e3b8ad
								
							
						
					
					
						commit
						35b1a69fcf
					
				| @ -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) | ||||
|  | ||||
| @ -14,8 +14,17 @@ forward void OnRunThinkFunctionsPost(bool simulating); | ||||
| // REMEMBER TO CALL THIS AGAIN WITH -1 AFTER USING IT !!!
 | ||||
| native void FilterTriggerMoved(int entity); | ||||
| 
 | ||||
| // -1 = Ignore, normal operation.
 | ||||
| // 0 = Block ALL SV_TriggerMoved.
 | ||||
| // >0 = Entity index for which to allow SV_TriggerMoved to be called.
 | ||||
| // REMEMBER TO CALL THIS AGAIN WITH -1 AFTER USING IT !!!
 | ||||
| native void BlockSolidMoved(int entity); | ||||
| 
 | ||||
| // entities is an array which maps from entindex to a truth value
 | ||||
| // if the value is true then SolidMoved will not see this entity
 | ||||
| // REMEMBER TO CALL THIS WITH SIZE 0 0N PLUGIN END !!!
 | ||||
| native void FilterSolidMoved(int[] entities, int size); | ||||
| 
 | ||||
| public Extension __ext_CSSFixes = | ||||
| { | ||||
| 	name = "CSSFixes", | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user