Moderator: MacroQuest Developers


Code: Select all
class CCommandHook
{
public:
VOID Detour(PSPAWNINFO pChar, PCHAR szFullLine)
{
//DebugSpew("CCommandHook::Detour(%s)",szFullLine);
// apply one alias
char FullCommand[8192];
strcpy(FullCommand,szFullLine);
szFullLine=FullCommand;
char *pSpace=strchr(FullCommand,' ');
if (pSpace)
*pSpace=0;
PISXEQALIAS pAlias=FindISXEQAlias(FullCommand);
[color=red] if (pAlias)[/color]
StrReplaceSection(FullCommand,strlen(FullCommand),pAlias->Replacement);
if (pSpace)
*pSpace=' ';
if (szFullLine[0]=='#')
{
pISInterface->ExecuteCommand(&szFullLine[1]);
strcpy(szLastCommand,szFullLine);
}
