mirror of
https://github.com/ineedbots/cod2m.git
synced 2025-08-31 18:17:25 +00:00
Added bot movement hook
This commit is contained in:
@@ -12,10 +12,29 @@ namespace Components
|
||||
return sprintf(buffer, ConnectString, botName, protocol);
|
||||
}
|
||||
|
||||
void Bots::SV_BotUserMove_Func(Game::client_t*)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
__declspec(naked) void Bots::SV_BotUserMove_Stub()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push esi;
|
||||
call SV_BotUserMove_Func;
|
||||
add esp, 4;
|
||||
retn;
|
||||
}
|
||||
}
|
||||
|
||||
Bots::Bots()
|
||||
{
|
||||
// intercept the sprintf when creating the bot connect string
|
||||
Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick();
|
||||
|
||||
// hook bot movement
|
||||
Utils::Hook(0x45C210, SV_BotUserMove_Stub, HOOK_JUMP).install()->quick();
|
||||
}
|
||||
|
||||
Bots::~Bots()
|
||||
|
@@ -11,5 +11,7 @@ namespace Components
|
||||
static const char* ConnectString;
|
||||
|
||||
static int BuildConnectString(char*, const char*, int, int);
|
||||
static void SV_BotUserMove_Func(Game::client_t*);
|
||||
static void SV_BotUserMove_Stub();
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user