This is working just fine under Windows. But in Linux, when the entity gets killed by a HE grenade it result to a Segmentation fault. Always.
Any idea why this just happens with HEs?
Have tried without even AMXX to make sure no plugins conflict with it.
Code:
#ifdef _WIN32
void __fastcall HookKilled
( void *pthis, int i, entvars_t *pevAttacker, int iGib
)
#elif __linux__
void HookKilled
( void *pthis, entvars_t *pevAttacker, int iGib
)
#endif
{
META_CONS
("HookKilled");
#ifdef _WIN32
reinterpret_cast<int
(__fastcall *
)(void *, int, entvars_t *, int
)>
(g_Killed_Hook.
address)(pthis, DUMMY_VAL, pevAttacker, iGib
);
#elif __linux__
reinterpret_cast<int (*)(void *, entvars_t *, int)>(g_Killed_Hook.address)(pthis, pevAttacker, iGib); // this is causing it (also tried with void* instead of int)
#endif
META_CONS
("HookKilled -- continue");
edict_t* pVictim = PrivateToEdict
( pthis
);
if (!IsValidPev
(pVictim
))
{
return;
}
}