Fix linux build again

This commit is contained in:
Peace-Maker 2016-03-08 16:57:07 +01:00
parent b8c666cac0
commit 22c3803718
2 changed files with 13 additions and 7 deletions

View File

@ -66,8 +66,8 @@ public:
void HookRecorder(IDemoRecorder *recorder);
void UnhookRecorder(IDemoRecorder *recorder);
void HookServer(IServer *server);
void UnhookServer(IServer *server);
void HookServer(HLTVServerWrapper *server);
void UnhookServer(HLTVServerWrapper *server);
void CallOnServerStart(IHLTVServer *server);
void CallOnServerShutdown(IHLTVServer *server);
@ -110,4 +110,4 @@ private:
extern CForwardManager g_pSTVForwards;
#endif // _INCLUDE_SOURCEMOD_EXTENSION_FORWARDS_H_
#endif // _INCLUDE_SOURCEMOD_EXTENSION_FORWARDS_H_

View File

@ -93,7 +93,8 @@ void HLTVServerWrapper::Hook()
return;
g_pSTVForwards.HookServer(this);
g_pSTVForwards.HookRecorder(m_DemoRecorder);
if (m_DemoRecorder)
g_pSTVForwards.HookRecorder(m_DemoRecorder);
if (g_HLTVServers.HasShutdownOffset())
SH_ADD_MANUALHOOK(CHLTVServer_Shutdown, m_HLTVServer->GetBaseServer(), SH_MEMBER(this, &HLTVServerWrapper::OnHLTVServerShutdown), false);
@ -118,7 +119,8 @@ void HLTVServerWrapper::Unhook()
return;
g_pSTVForwards.UnhookServer(this);
g_pSTVForwards.UnhookRecorder(m_DemoRecorder);
if (m_DemoRecorder)
g_pSTVForwards.UnhookRecorder(m_DemoRecorder);
if (g_HLTVServers.HasShutdownOffset())
SH_REMOVE_MANUALHOOK(CHLTVServer_Shutdown, m_HLTVServer->GetBaseServer(), SH_MEMBER(this, &HLTVServerWrapper::OnHLTVServerShutdown), false);
@ -359,8 +361,12 @@ IDemoRecorder *HLTVServerWrapperManager::GetDemoRecorderPtr(IHLTVServer *hltv)
return (IDemoRecorder *)((intptr_t)hltv + offset);
#else
IServer *baseServer = hltv->GetBaseServer();
#ifndef WIN32
return (IDemoRecorder *)((intptr_t)baseServer + offset - 4);
#else
return (IDemoRecorder *)((intptr_t)baseServer + offset);
#endif
#endif // WIN32
#endif // SOURCE_ENGINE == SE_CSGO
}
else
{
@ -391,4 +397,4 @@ bool HLTVServerWrapperManager::OnHLTVBotNetChanSendNetMsg(INetMessage &msg, bool
}
#endif
HLTVServerWrapperManager g_HLTVServers;
HLTVServerWrapperManager g_HLTVServers;