This is my understanding from what I read of Peace-Maker's reply. You are to store the entity data in pre hook phase as opposed to using DHookGetParam in post hook.
I don't have a windows server running, so this is an untested version, but it should work.
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <dhooks>
// Global Variables to store parameters.
int g_iEntityOne;
int g_iEntityTwo;
public OnPluginStart()
{
// Setup gamedata file
GameData hData = new GameData("l4dcollisionhook");
Handle hDetour = DHookCreateFromConf(hData, "PassEntityFilter");
if( !hDetour )
SetFailState("Failed to find \"PassEntityFilter\" offset.");
delete hData;
// Setup pre hook to grab parameters
if( !DHookEnableDetour(hDetour, false, detour_pre) )
SetFailState("Failed to detour \"PassEntityFilter\". pre");
// Setup post hook
if( !DHookEnableDetour(hDetour, true, detour_post) )
SetFailState("Failed to detour \"PassEntityFilter\". post");
}
public MRESReturn detour_pre(Handle hReturn, Handle hParams)
{
// Store prehook parameters into global variables
g_iEntityOne = DHookGetParam(hParams, 1);
g_iEntityTwo = DHookGetParam(hParams, 2);
PrintToServer("Entity 1 %i Entity 2 %i", DHookGetParam(hParams, 1), DHookGetParam(hParams, 2));
return MRES_Ignored;
}
public MRESReturn detour_post(Handle hReturn, Handle hParams)
{
PrintToServer("Entity 1 %i Entity 2 %i", g_iEntityOne, g_iEntityTwo);
return MRES_Ignored;
}
__________________