mirror of
https://github.com/ineedbots/cod2m.git
synced 2025-04-20 08:15:43 +00:00
Added custom bot names
This commit is contained in:
parent
bc91d819ea
commit
3ed8a393d3
@ -3,8 +3,19 @@
|
|||||||
|
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
|
const char* Bots::ConnectString = "connect \"\\cg_predictItems\\1\\cl_punkbuster\\0\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\"
|
||||||
|
"rate\\5000\\name\\%s\\protocol\\%d\"";
|
||||||
|
|
||||||
|
int Bots::BuildConnectString(char* buffer, const char*, [[maybe_unused]] int num, int protocol)
|
||||||
|
{
|
||||||
|
const char* botName = Utils::String::VA("bota%d", num);
|
||||||
|
return sprintf(buffer, ConnectString, botName, protocol);
|
||||||
|
}
|
||||||
|
|
||||||
Bots::Bots()
|
Bots::Bots()
|
||||||
{
|
{
|
||||||
|
// intercept the sprintf when creating the bot connect string
|
||||||
|
Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bots::~Bots()
|
Bots::~Bots()
|
||||||
|
@ -7,5 +7,9 @@ namespace Components
|
|||||||
public:
|
public:
|
||||||
Bots();
|
Bots();
|
||||||
~Bots();
|
~Bots();
|
||||||
|
private:
|
||||||
|
static const char* ConnectString;
|
||||||
|
|
||||||
|
static int BuildConnectString(char*, const char*, int, int);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user