Updated for latest hl2sdk-dota changes.
This commit is contained in:
@@ -45,7 +45,7 @@ public: //IRecipientFilter
|
||||
bool IsInitMessage() const;
|
||||
int GetRecipientCount() const;
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void GetRecipientIndex(int *clientIndex, int slot) const;
|
||||
CEntityIndex GetRecipientIndex(int slot) const;
|
||||
#else
|
||||
int GetRecipientIndex(int slot) const;
|
||||
#endif
|
||||
@@ -84,7 +84,7 @@ inline int CellRecipientFilter::GetRecipientCount() const
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
inline void CellRecipientFilter::GetRecipientIndex(int *clientIndex, int slot) const
|
||||
inline CEntityIndex CellRecipientFilter::GetRecipientIndex(int slot) const
|
||||
#else
|
||||
inline int CellRecipientFilter::GetRecipientIndex(int slot) const
|
||||
#endif
|
||||
@@ -97,7 +97,7 @@ inline int CellRecipientFilter::GetRecipientIndex(int slot) const
|
||||
ret = static_cast<int>(m_Players[slot]);
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
*clientIndex = ret;
|
||||
return CEntityIndex(ret);
|
||||
#else
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
@@ -94,7 +94,7 @@ public: // IVoiceServer
|
||||
bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
|
||||
void VoiceInit();
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void OnClientCommand(int client, const CCommand &args);
|
||||
void OnClientCommand(CEntityIndex index, const CCommand &args);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
void OnClientCommand(edict_t *pEntity, const CCommand &args);
|
||||
#else
|
||||
|
||||
@@ -140,7 +140,7 @@ size_t TempEntHooks::_FillInPlayers(int *pl_array, IRecipientFilter *pFilter)
|
||||
{
|
||||
int index;
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
pFilter->GetRecipientIndex(&index, i);
|
||||
index = pFilter->GetRecipientIndex(i).Get();
|
||||
#else
|
||||
index = pFilter->GetRecipientIndex(i);
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ bool g_ClientMutes[65][65];
|
||||
SH_DECL_HOOK3(IVoiceServer, SetClientListening, SH_NOATTRIB, 0, bool, int, int, bool);
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, int, const CCommand &);
|
||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, CEntityIndex, const CCommand &);
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
|
||||
#else
|
||||
@@ -94,8 +94,9 @@ void SDKTools::VoiceInit()
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void SDKTools::OnClientCommand(int client, const CCommand &args)
|
||||
void SDKTools::OnClientCommand(CEntityIndex index, const CCommand &args)
|
||||
{
|
||||
int client = index.Get();
|
||||
#elif SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
void SDKTools::OnClientCommand(edict_t *pEntity, const CCommand &args)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,12 @@
|
||||
#include "vsound.h"
|
||||
#include <IForwardSys.h>
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, CEntityIndex, const Vector &, const char *, float, soundlevel_t, int, int, float);
|
||||
#else
|
||||
SH_DECL_HOOK8_void(IVEngineServer, EmitAmbientSound, SH_NOATTRIB, 0, int, const Vector &, const char *, float, soundlevel_t, int, int, float);
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE >= SE_PORTAL2
|
||||
SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 0, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, float, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
|
||||
SH_DECL_HOOK17(IEngineSound, EmitSound, SH_NOATTRIB, 1, int, IRecipientFilter &, int, int, const char *, unsigned int, const char *, float, soundlevel_t, int, int, int, const Vector *, const Vector *, CUtlVector<Vector> *, bool, float, int);
|
||||
@@ -70,7 +75,7 @@ size_t SoundHooks::_FillInPlayers(int *pl_array, IRecipientFilter *pFilter)
|
||||
{
|
||||
int index;
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
pFilter->GetRecipientIndex(&index, i);
|
||||
index = pFilter->GetRecipientIndex(i).Get();
|
||||
#else
|
||||
index = pFilter->GetRecipientIndex(i);
|
||||
#endif
|
||||
@@ -221,9 +226,16 @@ bool SoundHooks::RemoveHook(int type, IPluginFunction *pFunc)
|
||||
return false;
|
||||
}
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void SoundHooks::OnEmitAmbientSound(CEntityIndex index, const Vector &pos, const char *samp, float vol,
|
||||
soundlevel_t soundlevel, int fFlags, int pitch, float delay)
|
||||
{
|
||||
int entindex = index.Get();
|
||||
#else
|
||||
void SoundHooks::OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol,
|
||||
soundlevel_t soundlevel, int fFlags, int pitch, float delay)
|
||||
{
|
||||
#endif
|
||||
SoundHookIter iter;
|
||||
IPluginFunction *pFunc;
|
||||
cell_t vec[3] = {sp_ftoc(pos.x), sp_ftoc(pos.y), sp_ftoc(pos.z)};
|
||||
@@ -259,8 +271,13 @@ void SoundHooks::OnEmitAmbientSound(int entindex, const Vector &pos, const char
|
||||
vec2.x = sp_ctof(vec[0]);
|
||||
vec2.y = sp_ctof(vec[1]);
|
||||
vec2.z = sp_ctof(vec[2]);
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::EmitAmbientSound,
|
||||
(CEntityIndex(entindex), vec2, buffer, vol, soundlevel, fFlags, pitch, delay));
|
||||
#else
|
||||
RETURN_META_NEWPARAMS(MRES_IGNORED, &IVEngineServer::EmitAmbientSound,
|
||||
(entindex, vec2, buffer, vol, soundlevel, fFlags, pitch, delay));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,14 @@ public:
|
||||
void Shutdown();
|
||||
void AddHook(int type, IPluginFunction *pFunc);
|
||||
bool RemoveHook(int type, IPluginFunction *pFunc);
|
||||
#if SOURCE_ENGINE >= SE_PORTAL2
|
||||
|
||||
#if SOURCE_ENGINE == SE_DOTA
|
||||
void OnEmitAmbientSound(CEntityIndex index, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
|
||||
#else
|
||||
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol, soundlevel_t soundlevel, int fFlags, int pitch, float delay);
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE >= SE_PORTAL2
|
||||
int OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *, unsigned int, const char *pSample, float flVolume,
|
||||
soundlevel_t iSoundlevel, int nSeed, int iFlags, int iPitch, const Vector *pOrigin,
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
@@ -61,8 +67,6 @@ public:
|
||||
const Vector *pDirection, CUtlVector<Vector> *pUtlVecOrigins, bool bUpdatePositions,
|
||||
float soundtime, int speakerentity);
|
||||
#else
|
||||
void OnEmitAmbientSound(int entindex, const Vector &pos, const char *samp, float vol,
|
||||
soundlevel_t soundlevel, int fFlags, int pitch, float delay);
|
||||
#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS
|
||||
|
||||
void OnEmitSound(IRecipientFilter& filter, int iEntIndex, int iChannel, const char *pSample, float flVolume,
|
||||
|
||||
Reference in New Issue
Block a user