update HookSendSound

This commit is contained in:
not-log 2021-06-04 17:59:23 +03:00
parent fbc5084f55
commit 2e25c3ef98

View File

@ -274,20 +274,21 @@ void HookSendSound()
DHookAddParam(hFunction, HookParamType_ObjectPtr);
DHookAddParam(hFunction, HookParamType_Bool);
StartPrepSDKCall(SDKCall_Raw);
PrepSDKCall_SetFromConf(hGameData, SDKConf_Virtual, "CBaseClient::GetPlayerSlot");
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
if (!(gH_GetPlayerSlot = EndPrepSDKCall()))
{
SetFailState("Could not initialize call to CBaseClient::GetPlayerSlot.");
}
if(!DHookEnableDetour(hFunction, false, DHook_SendSound))
{
SetFailState("Couldn't enable CGameClient::SendSound detour.");
}
StartPrepSDKCall(SDKCall_Raw);
PrepSDKCall_SetFromConf(hGameData, SDKConf_Virtual, "CBaseClient::GetPlayerSlot");
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
gH_GetPlayerSlot = EndPrepSDKCall();
if(gH_GetPlayerSlot == null)
{
SetFailState("Could not initialize call to CBaseClient::GetPlayerSlot.");
}
delete hGameData;
}