Fix firing OnShutdown with wrong instance index on mapchange

Prehook RemoveHLTVServer, so we can still find the instance in the
director when trying to figure out the instance index.
This commit is contained in:
Peace-Maker 2016-03-15 12:25:20 +01:00
parent 9ae2431375
commit 1e0133c375
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ void SourceTVManager::SDK_OnAllLoaded()
{
#if SOURCE_ENGINE == SE_CSGO
SH_ADD_HOOK(IHLTVDirector, AddHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnAddHLTVServer_Post), true);
SH_ADD_HOOK(IHLTVDirector, RemoveHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnRemoveHLTVServer_Post), true);
SH_ADD_HOOK(IHLTVDirector, RemoveHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnRemoveHLTVServer), false);
#else
SH_ADD_HOOK(IHLTVDirector, SetHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnSetHLTVServer_Post), true);
#endif
@ -166,7 +166,7 @@ void SourceTVManager::SDK_OnUnload()
{
#if SOURCE_ENGINE == SE_CSGO
SH_REMOVE_HOOK(IHLTVDirector, AddHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnAddHLTVServer_Post), true);
SH_REMOVE_HOOK(IHLTVDirector, RemoveHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnRemoveHLTVServer_Post), true);
SH_REMOVE_HOOK(IHLTVDirector, RemoveHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnRemoveHLTVServer), false);
#else
SH_REMOVE_HOOK(IHLTVDirector, SetHLTVServer, hltvdirector, SH_MEMBER(this, &SourceTVManager::OnSetHLTVServer_Post), true);
#endif
@ -218,7 +218,7 @@ void SourceTVManager::OnAddHLTVServer_Post(IHLTVServer *hltv)
RETURN_META(MRES_IGNORED);
}
void SourceTVManager::OnRemoveHLTVServer_Post(IHLTVServer *hltv)
void SourceTVManager::OnRemoveHLTVServer(IHLTVServer *hltv)
{
HLTVServerWrapper *wrapper = g_HLTVServers.GetWrapper(hltv);
if (!wrapper)

View File

@ -143,7 +143,7 @@ public:
private:
#if SOURCE_ENGINE == SE_CSGO
void OnAddHLTVServer_Post(IHLTVServer *hltv);
void OnRemoveHLTVServer_Post(IHLTVServer *hltv);
void OnRemoveHLTVServer(IHLTVServer *hltv);
#else
void OnSetHLTVServer_Post(IHLTVServer *hltv);
#endif