diff --git a/core/ChatTriggers.cpp b/core/ChatTriggers.cpp index 9c72b000..42f4607b 100644 --- a/core/ChatTriggers.cpp +++ b/core/ChatTriggers.cpp @@ -283,7 +283,11 @@ void ChatTriggers::OnSayCommand_Post() /* Execute the cached command */ int client = g_ConCmds.GetCommandClient(); unsigned int old = SetReplyTo(SM_REPLY_CHAT); +#if SOURCE_ENGINE == SE_DOTA + engine->ClientCommand(PEntityOfEntIndex(client), "%s", m_ToExecute); +#else serverpluginhelpers->ClientCommand(PEntityOfEntIndex(client), m_ToExecute); +#endif SetReplyTo(old); } } diff --git a/core/ConVarManager.cpp b/core/ConVarManager.cpp index eaca606b..07414884 100644 --- a/core/ConVarManager.cpp +++ b/core/ConVarManager.cpp @@ -614,10 +614,12 @@ QueryCvarCookie_t ConVarManager::QueryClientConVar(edict_t *pPlayer, const char { cookie = engine->StartQueryCvarValue(pPlayer, name); } +#if SOURCE_ENGINE != SE_DOTA else if (m_bIsVSPQueryHooked) { cookie = serverpluginhelpers->StartQueryCvarValue(pPlayer, name); } +#endif else { return InvalidQueryCvarCookie; diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 73ad7d0d..fedd3e0b 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -733,7 +733,11 @@ void CHalfLife2::ProcessFakeCliCmdQueue() if (g_Players.GetClientOfUserId(pFake->userid) == pFake->client) { CPlayer *pPlayer = g_Players.GetPlayerByIndex(pFake->client); +#if SOURCE_ENGINE == SE_DOTA + engine->ClientCommand(pPlayer->GetEdict(), "%s", pFake->cmd.c_str()); +#else serverpluginhelpers->ClientCommand(pPlayer->GetEdict(), pFake->cmd.c_str()); +#endif } m_CmdQueue.pop(); diff --git a/core/MenuStyle_Valve.cpp b/core/MenuStyle_Valve.cpp index 0b6767eb..97e551d9 100644 --- a/core/MenuStyle_Valve.cpp +++ b/core/MenuStyle_Valve.cpp @@ -65,16 +65,20 @@ bool ValveMenuStyle::OnClientCommand(int client, const char *cmdname, const CCom void ValveMenuStyle::OnSourceModAllInitialized() { +#if SOURCE_ENGINE != SE_DOTA g_Players.AddClientListener(this); SH_ADD_HOOK(IServerPluginHelpers, CreateMessage, serverpluginhelpers, SH_MEMBER(this, &ValveMenuStyle::HookCreateMessage), false); g_pSPHCC = SH_GET_CALLCLASS(serverpluginhelpers); +#endif } void ValveMenuStyle::OnSourceModShutdown() { +#if SOURCE_ENGINE != SE_DOTA SH_RELEASE_CALLCLASS(g_pSPHCC); SH_REMOVE_HOOK(IServerPluginHelpers, CreateMessage, serverpluginhelpers, SH_MEMBER(this, &ValveMenuStyle::HookCreateMessage), false); g_Players.RemoveClientListener(this); +#endif } void ValveMenuStyle::HookCreateMessage(edict_t *pEdict, diff --git a/core/smn_console.cpp b/core/smn_console.cpp index cc2afd99..e8bd6f76 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -1105,7 +1105,11 @@ static cell_t FakeClientCommand(IPluginContext *pContext, const cell_t *params) return 0; } +#if SOURCE_ENGINE == SE_DOTA + engine->ClientCommand(pPlayer->GetEdict(), "%s", buffer); +#else serverpluginhelpers->ClientCommand(pPlayer->GetEdict(), buffer); +#endif return 1; } diff --git a/core/smn_halflife.cpp b/core/smn_halflife.cpp index 96ad9d46..ec6c1d14 100644 --- a/core/smn_halflife.cpp +++ b/core/smn_halflife.cpp @@ -254,6 +254,9 @@ static cell_t IsSoundPrecached(IPluginContext *pContext, const cell_t *params) static cell_t smn_CreateDialog(IPluginContext *pContext, const cell_t *params) { +#if SOURCE_ENGINE == SE_DOTA + return pContext->ThrowNativeError("CreateDialog is not supported on this game"); +#else KeyValues *pKV; HandleError herr; Handle_t hndl = static_cast(params[2]); @@ -281,6 +284,7 @@ static cell_t smn_CreateDialog(IPluginContext *pContext, const cell_t *params) vsp_interface); return 1; +#endif // DOTA } static cell_t PrintToChat(IPluginContext *pContext, const cell_t *params) diff --git a/core/sourcemm_api.cpp b/core/sourcemm_api.cpp index 6a3b74d1..274f807b 100644 --- a/core/sourcemm_api.cpp +++ b/core/sourcemm_api.cpp @@ -69,7 +69,9 @@ bool SourceMod_Core::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen GET_V_IFACE_CURRENT(GetEngineFactory, engrandom, IUniformRandomStream, VENGINE_SERVER_RANDOM_INTERFACE_VERSION); GET_V_IFACE_CURRENT(GetFileSystemFactory, basefilesystem, IBaseFileSystem, BASEFILESYSTEM_INTERFACE_VERSION); GET_V_IFACE_CURRENT(GetEngineFactory, enginesound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION); +#if SOURCE_ENGINE != SE_DOTA GET_V_IFACE_CURRENT(GetEngineFactory, serverpluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS); +#endif /* :TODO: Make this optional and... make it find earlier versions [?] */ GET_V_IFACE_CURRENT(GetServerFactory, playerinfo, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER); diff --git a/extensions/sdktools/extension.cpp b/extensions/sdktools/extension.cpp index 655dd682..3e5e2027 100644 --- a/extensions/sdktools/extension.cpp +++ b/extensions/sdktools/extension.cpp @@ -247,7 +247,9 @@ bool SDKTools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool GET_V_IFACE_ANY(GetEngineFactory, engsound, IEngineSound, IENGINESOUND_SERVER_INTERFACE_VERSION); GET_V_IFACE_ANY(GetEngineFactory, enginetrace, IEngineTrace, INTERFACEVERSION_ENGINETRACE_SERVER); GET_V_IFACE_ANY(GetEngineFactory, netstringtables, INetworkStringTableContainer, INTERFACENAME_NETWORKSTRINGTABLESERVER); +#if SOURCE_ENGINE != SE_DOTA GET_V_IFACE_ANY(GetEngineFactory, pluginhelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS); +#endif GET_V_IFACE_ANY(GetServerFactory, serverClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS); GET_V_IFACE_ANY(GetEngineFactory, voiceserver, IVoiceServer, INTERFACEVERSION_VOICESERVER); GET_V_IFACE_ANY(GetServerFactory, playerinfomngr, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER); diff --git a/extensions/sdktools/vnatives.cpp b/extensions/sdktools/vnatives.cpp index 1e66715b..6a947760 100644 --- a/extensions/sdktools/vnatives.cpp +++ b/extensions/sdktools/vnatives.cpp @@ -565,7 +565,11 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params) /* Force suicide */ if (should_slay) { +#if SOURCE_ENGINE == SE_DOTA + engine->ClientCommand(pEdict, "kill\n"); +#else pluginhelpers->ClientCommand(pEdict, "kill\n"); +#endif } if (s_frag_offs > 0)