Updated for latest hl2sdk-dota changes.

This commit is contained in:
Nicholas Hastings
2013-05-13 15:18:12 -04:00
parent e8dc1480eb
commit 614967ccc1
17 changed files with 228 additions and 29 deletions
+3 -1
View File
@@ -93,7 +93,9 @@ public: //IClientListner
public: // IVoiceServer
bool OnSetClientListening(int iReceiver, int iSender, bool bListen);
void VoiceInit();
#if SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE == SE_DOTA
void OnClientCommand(int client, const CCommand &args);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
void OnClientCommand(edict_t *pEntity, const CCommand &args);
#else
void OnClientCommand(edict_t *pEntity);
+5
View File
@@ -217,7 +217,12 @@ int GetClientAimTarget(edict_t *pEdict, bool only_players)
QAngle eye_angles;
/* Get the private information we need */
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientEarPosition(IndexOfEdict(pEdict), &eye_position);
#else
serverClients->ClientEarPosition(pEdict, &eye_position);
#endif
if (!GetEyeAngles(pEntity, &eye_angles))
{
return -2;
+9 -1
View File
@@ -373,7 +373,11 @@ static cell_t SetClientViewEntity(IPluginContext *pContext, const cell_t *params
return pContext->ThrowNativeError("Entity %d is not valid", params[2]);
}
#if SOURCE_ENGINE == SE_DOTA
engine->SetView(params[1], params[2]);
#else
engine->SetView(player->GetEdict(), pEdict);
#endif
return 1;
}
@@ -566,7 +570,7 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params)
if (should_slay)
{
#if SOURCE_ENGINE == SE_DOTA
engine->ClientCommand(pEdict, "kill\n");
engine->ClientCommand(params[1], "kill\n");
#else
pluginhelpers->ClientCommand(pEdict, "kill\n");
#endif
@@ -593,7 +597,11 @@ static cell_t GetClientEyePosition(IPluginContext *pContext, const cell_t *param
}
Vector pos;
#if SOURCE_ENGINE == SE_DOTA
serverClients->ClientEarPosition(params[1], &pos);
#else
serverClients->ClientEarPosition(player->GetEdict(), &pos);
#endif
cell_t *addr;
pContext->LocalToPhysAddr(params[2], &addr);
+9 -3
View File
@@ -58,7 +58,9 @@ bool g_ClientMutes[65][65];
SH_DECL_HOOK3(IVoiceServer, SetClientListening, SH_NOATTRIB, 0, bool, int, int, bool);
#if SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE == SE_DOTA
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, int, const CCommand &);
#elif SOURCE_ENGINE >= SE_ORANGEBOX
SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *, const CCommand &);
#else
SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t *);
@@ -91,15 +93,19 @@ void SDKTools::VoiceInit()
SH_ADD_HOOK(IServerGameClients, ClientCommand, serverClients, SH_MEMBER(this, &SDKTools::OnClientCommand), true);
}
#if SOURCE_ENGINE >= SE_ORANGEBOX
#if SOURCE_ENGINE == SE_DOTA
void SDKTools::OnClientCommand(int client, const CCommand &args)
{
#elif SOURCE_ENGINE >= SE_ORANGEBOX
void SDKTools::OnClientCommand(edict_t *pEntity, const CCommand &args)
{
int client = IndexOfEdict(pEntity);
#else
void SDKTools::OnClientCommand(edict_t *pEntity)
{
CCommand args;
#endif
int client = IndexOfEdict(pEntity);
#endif
if ((args.ArgC() > 1) && (stricmp(args.Arg(0), "vban") == 0))
{
+6 -1
View File
@@ -521,7 +521,12 @@ static cell_t FadeClientVolume(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client index %d is not in game", client);
}
engine->FadeClientVolume(player->GetEdict(),
engine->FadeClientVolume(
#if SOURCE_ENGINE == SE_DOTA
player->GetIndex(),
#else
player->GetEdict(),
#endif
sp_ctof(params[2]),
sp_ctof(params[3]),
sp_ctof(params[4]),