Replace usages of deprecated Sourcehook Add/Remove macros (bug 5631, r=dvander).
This commit is contained in:
@@ -143,7 +143,7 @@ bool SDKTools::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||
#endif
|
||||
CONVAR_REGISTER(this);
|
||||
|
||||
SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SDKTools::LevelInit, true);
|
||||
SH_ADD_HOOK(IServerGameDLL, LevelInit, gamedll, SH_MEMBER(this, &SDKTools::LevelInit), true);
|
||||
|
||||
playerhelpers->RegisterCommandTargetProcessor(this);
|
||||
|
||||
@@ -210,7 +210,7 @@ void SDKTools::SDK_OnUnload()
|
||||
playerhelpers->UnregisterCommandTargetProcessor(this);
|
||||
plsys->RemovePluginsListener(&g_OutputManager);
|
||||
|
||||
SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, gamedll, this, &SDKTools::LevelInit, true);
|
||||
SH_REMOVE_HOOK(IServerGameDLL, LevelInit, gamedll, SH_MEMBER(this, &SDKTools::LevelInit), true);
|
||||
|
||||
if (enginePatch)
|
||||
{
|
||||
|
||||
@@ -105,7 +105,7 @@ void CHookManager::OnClientPutInServer(int client)
|
||||
return;
|
||||
}
|
||||
|
||||
SH_ADD_MANUALHOOK_MEMFUNC(PlayerRunCmdHook, pEntity, this, &CHookManager::PlayerRunCmd, false);
|
||||
SH_ADD_MANUALHOOK(PlayerRunCmdHook, pEntity, SH_MEMBER(this, &CHookManager::PlayerRunCmd), false);
|
||||
}
|
||||
|
||||
void CHookManager::OnClientDisconnecting(int client)
|
||||
@@ -134,7 +134,7 @@ void CHookManager::OnClientDisconnecting(int client)
|
||||
return;
|
||||
}
|
||||
|
||||
SH_REMOVE_MANUALHOOK_MEMFUNC(PlayerRunCmdHook, pEntity, this, &CHookManager::PlayerRunCmd, false);
|
||||
SH_REMOVE_MANUALHOOK(PlayerRunCmdHook, pEntity, SH_MEMBER(this, &CHookManager::PlayerRunCmd), false);
|
||||
}
|
||||
|
||||
void CHookManager::PlayerRunCmd(CUserCmd *ucmd, IMoveHelper *moveHelper)
|
||||
|
||||
@@ -120,7 +120,7 @@ void TempEntHooks::_IncRefCounter()
|
||||
{
|
||||
if (m_HookCount++ == 0)
|
||||
{
|
||||
SH_ADD_HOOK_MEMFUNC(IVEngineServer, PlaybackTempEntity, engine, this, &TempEntHooks::OnPlaybackTempEntity, false);
|
||||
SH_ADD_HOOK(IVEngineServer, PlaybackTempEntity, engine, SH_MEMBER(this, &TempEntHooks::OnPlaybackTempEntity), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void TempEntHooks::_DecRefCounter()
|
||||
{
|
||||
if (--m_HookCount == 0)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, PlaybackTempEntity, engine, this, &TempEntHooks::OnPlaybackTempEntity, false);
|
||||
SH_REMOVE_HOOK(IVEngineServer, PlaybackTempEntity, engine, SH_MEMBER(this, &TempEntHooks::OnPlaybackTempEntity), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ bool DecHookCount()
|
||||
{
|
||||
if (g_VoiceHookCount == 0)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IVoiceServer, SetClientListening, voiceserver, &g_SdkTools, &SDKTools::OnSetClientListening, false);
|
||||
SH_REMOVE_HOOK(IVoiceServer, SetClientListening, voiceserver, SH_MEMBER(&g_SdkTools, &SDKTools::OnSetClientListening), false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void IncHookCount()
|
||||
{
|
||||
if (!g_VoiceHookCount++)
|
||||
{
|
||||
SH_ADD_HOOK_MEMFUNC(IVoiceServer, SetClientListening, voiceserver, &g_SdkTools, &SDKTools::OnSetClientListening, false);
|
||||
SH_ADD_HOOK(IVoiceServer, SetClientListening, voiceserver, SH_MEMBER(&g_SdkTools, &SDKTools::OnSetClientListening), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void SDKTools::VoiceInit()
|
||||
memset(g_VoiceMap, 0, sizeof(g_VoiceMap));
|
||||
memset(g_ClientMutes, 0, sizeof(g_ClientMutes));
|
||||
|
||||
SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, serverClients, this, &SDKTools::OnClientCommand, true);
|
||||
SH_ADD_HOOK(IServerGameClients, ClientCommand, serverClients, SH_MEMBER(this, &SDKTools::OnClientCommand), true);
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
|
||||
@@ -80,15 +80,15 @@ void SoundHooks::_IncRefCounter(int type)
|
||||
{
|
||||
if (m_NormalCount++ == 0)
|
||||
{
|
||||
SH_ADD_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound, false);
|
||||
SH_ADD_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound2, false);
|
||||
SH_ADD_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound), false);
|
||||
SH_ADD_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound2), false);
|
||||
}
|
||||
}
|
||||
else if (type == AMBIENT_SOUND_HOOK)
|
||||
{
|
||||
if (m_AmbientCount++ == 0)
|
||||
{
|
||||
SH_ADD_HOOK_MEMFUNC(IVEngineServer, EmitAmbientSound, engine, this, &SoundHooks::OnEmitAmbientSound, false);
|
||||
SH_ADD_HOOK(IVEngineServer, EmitAmbientSound, engine, SH_MEMBER(this, &SoundHooks::OnEmitAmbientSound), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,15 +99,15 @@ void SoundHooks::_DecRefCounter(int type)
|
||||
{
|
||||
if (--m_NormalCount == 0)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound, false);
|
||||
SH_REMOVE_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound2, false);
|
||||
SH_REMOVE_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound), false);
|
||||
SH_REMOVE_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound2), false);
|
||||
}
|
||||
}
|
||||
else if (type == AMBIENT_SOUND_HOOK)
|
||||
{
|
||||
if (--m_AmbientCount == 0)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, EmitAmbientSound, engine, this, &SoundHooks::OnEmitAmbientSound, false);
|
||||
SH_REMOVE_HOOK(IVEngineServer, EmitAmbientSound, engine, SH_MEMBER(this, &SoundHooks::OnEmitAmbientSound), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,12 +122,12 @@ void SoundHooks::Shutdown()
|
||||
plsys->RemovePluginsListener(this);
|
||||
if (m_NormalCount)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound, false);
|
||||
SH_REMOVE_HOOK_MEMFUNC(IEngineSound, EmitSound, engsound, this, &SoundHooks::OnEmitSound2, false);
|
||||
SH_REMOVE_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound), false);
|
||||
SH_REMOVE_HOOK(IEngineSound, EmitSound, engsound, SH_MEMBER(this, &SoundHooks::OnEmitSound2), false);
|
||||
}
|
||||
if (m_AmbientCount)
|
||||
{
|
||||
SH_REMOVE_HOOK_MEMFUNC(IVEngineServer, EmitAmbientSound, engine, this, &SoundHooks::OnEmitAmbientSound, false);
|
||||
SH_REMOVE_HOOK(IVEngineServer, EmitAmbientSound, engine, SH_MEMBER(this, &SoundHooks::OnEmitAmbientSound), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user