mirror of
https://github.com/Haze1337/Sound-Manager.git
synced 2025-12-07 10:28:33 +00:00
removed extra handle deletion
This commit is contained in:
parent
f2fcfa50e1
commit
fbc5084f55
@ -148,7 +148,6 @@ void HookSoundScapes()
|
||||
Handle hGameData = LoadGameConfigFile("SoundManager.games");
|
||||
if(!hGameData)
|
||||
{
|
||||
delete hGameData;
|
||||
SetFailState("Failed to load SoundManager gamedata.");
|
||||
}
|
||||
|
||||
@ -156,12 +155,12 @@ void HookSoundScapes()
|
||||
DHookSetFromConf(hFunction, hGameData, SDKConf_Signature, "CEnvSoundscape::UpdateForPlayer");
|
||||
DHookAddParam(hFunction, HookParamType_ObjectPtr);
|
||||
|
||||
delete hGameData;
|
||||
|
||||
if(!DHookEnableDetour(hFunction, false, DHook_UpdateForPlayer))
|
||||
{
|
||||
SetFailState("Couldn't enable CEnvSoundscape::UpdateForPlayer detour.");
|
||||
}
|
||||
|
||||
delete hGameData;
|
||||
}
|
||||
|
||||
//void CEnvSoundscape::UpdateForPlayer( ss_update_t &update )
|
||||
@ -203,14 +202,11 @@ void HookAcceptInput()
|
||||
Handle hGameData = LoadGameConfigFile("SoundManager.games");
|
||||
if(!hGameData)
|
||||
{
|
||||
delete hGameData;
|
||||
SetFailState("Failed to load SoundManager gamedata.");
|
||||
}
|
||||
|
||||
int offset = GameConfGetOffset(hGameData, "AcceptInput");
|
||||
|
||||
delete hGameData;
|
||||
|
||||
if(offset == 0)
|
||||
{
|
||||
SetFailState("Failed to load \"AcceptInput\", invalid offset.");
|
||||
@ -222,6 +218,8 @@ void HookAcceptInput()
|
||||
DHookAddParam(gH_AcceptInput, HookParamType_CBaseEntity);
|
||||
DHookAddParam(gH_AcceptInput, HookParamType_Object, 20, DHookPass_ByVal|DHookPass_ODTOR|DHookPass_OCTOR|DHookPass_OASSIGNOP);
|
||||
DHookAddParam(gH_AcceptInput, HookParamType_Int);
|
||||
|
||||
delete hGameData;
|
||||
}
|
||||
|
||||
// virtual bool AcceptInput( const char *szInputName, CBaseEntity *pActivator, CBaseEntity *pCaller, variant_t Value, int outputID );
|
||||
@ -268,7 +266,6 @@ void HookSendSound()
|
||||
Handle hGameData = LoadGameConfigFile("SoundManager.games");
|
||||
if(!hGameData)
|
||||
{
|
||||
delete hGameData;
|
||||
SetFailState("Failed to load SoundManager gamedata.");
|
||||
}
|
||||
|
||||
@ -281,8 +278,6 @@ void HookSendSound()
|
||||
PrepSDKCall_SetFromConf(hGameData, SDKConf_Virtual, "CBaseClient::GetPlayerSlot");
|
||||
PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain);
|
||||
|
||||
delete hGameData;
|
||||
|
||||
if (!(gH_GetPlayerSlot = EndPrepSDKCall()))
|
||||
{
|
||||
SetFailState("Could not initialize call to CBaseClient::GetPlayerSlot.");
|
||||
@ -292,6 +287,8 @@ void HookSendSound()
|
||||
{
|
||||
SetFailState("Couldn't enable CGameClient::SendSound detour.");
|
||||
}
|
||||
|
||||
delete hGameData;
|
||||
}
|
||||
|
||||
//void CGameClient::SendSound( SoundInfo_t &sound, bool isReliable )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user