Added generic command hooking mechanism, to replace Reg*Cmd which is intended for command creation (bug 4015, r=pred).

This commit is contained in:
David Anderson
2009-09-26 17:12:23 -04:00
parent 493a756aaa
commit d8474cfafa
14 changed files with 288 additions and 37 deletions
+15
View File
@@ -48,6 +48,7 @@
#include "GameConfigs.h"
#include "ExtensionSys.h"
#include <sourcemod_version.h>
#include "ConsoleDetours.h"
PlayerManager g_Players;
bool g_OnMapStarted = false;
@@ -725,6 +726,20 @@ void PlayerManager::OnClientCommand(edict_t *pEntity)
}
}
if (g_ConsoleDetours.IsEnabled())
{
cell_t res2 = g_ConsoleDetours.InternalDispatch(client, args);
if (res2 >= Pl_Stop)
{
g_HL2.PopCommandStack();
RETURN_META(MRES_SUPERCEDE);
}
else if (res2 > res)
{
res = res2;
}
}
cell_t res2 = Pl_Continue;
m_clcommand->PushCell(client);
m_clcommand->PushCell(argcount);