mirror of
https://github.com/ineedbots/cod2m.git
synced 2025-04-19 16:02:53 +00:00
Added bot movement hook
This commit is contained in:
parent
3ed8a393d3
commit
a02827278e
@ -1,4 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
echo Updating submodules...
|
echo Updating submodules...
|
||||||
call git submodule update --init --recursive
|
call git submodule update --init --recursive
|
||||||
call tools\premake5 %* vs2019
|
call tools\premake5 %* vs2019 --copy-to="G:\SteamLibrary\steamapps\common\Call of Duty 2"
|
||||||
|
@ -12,10 +12,29 @@ namespace Components
|
|||||||
return sprintf(buffer, ConnectString, botName, protocol);
|
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()
|
Bots::Bots()
|
||||||
{
|
{
|
||||||
// intercept the sprintf when creating the bot connect string
|
// intercept the sprintf when creating the bot connect string
|
||||||
Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick();
|
Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick();
|
||||||
|
|
||||||
|
// hook bot movement
|
||||||
|
Utils::Hook(0x45C210, SV_BotUserMove_Stub, HOOK_JUMP).install()->quick();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bots::~Bots()
|
Bots::~Bots()
|
||||||
|
@ -11,5 +11,7 @@ namespace Components
|
|||||||
static const char* ConnectString;
|
static const char* ConnectString;
|
||||||
|
|
||||||
static int BuildConnectString(char*, const char*, int, int);
|
static int BuildConnectString(char*, const char*, int, int);
|
||||||
|
static void SV_BotUserMove_Func(Game::client_t*);
|
||||||
|
static void SV_BotUserMove_Stub();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user