diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index 6c03c93..7facd08 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -3,8 +3,19 @@ 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() { + // intercept the sprintf when creating the bot connect string + Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick(); } Bots::~Bots() diff --git a/src/Components/Modules/Bots.hpp b/src/Components/Modules/Bots.hpp index c3dd34f..ccc7da2 100644 --- a/src/Components/Modules/Bots.hpp +++ b/src/Components/Modules/Bots.hpp @@ -7,5 +7,9 @@ namespace Components public: Bots(); ~Bots(); + private: + static const char* ConnectString; + + static int BuildConnectString(char*, const char*, int, int); }; }