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:
parent
9ae2431375
commit
1e0133c375
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user