using dhooks to hook TraceAttack on CS:GO, but it crashes after the callback is executed (PrintToServer effectively prints something before the server crashes).
what could be the problem? no error message before crashing and no log explaining what would be the culprit
edit: managed to fix the crash, the params weren't correct. here is the correct way to hook TraceAttack, for anyone interested:
Code:
DHOOK_TraceAttack = DHookCreate(offset, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, TraceAttack);
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByRef); // CTakeDamageInfo const&
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByRef); // Vector const&
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByVal); // CGameTrace*