mirror of
https://github.com/ineedbots/cod2m.git
synced 2025-04-19 16:02:53 +00:00
Fix it up
This commit is contained in:
parent
a02827278e
commit
bb54910614
@ -12,9 +12,15 @@ namespace Components
|
||||
return sprintf(buffer, ConnectString, botName, protocol);
|
||||
}
|
||||
|
||||
void Bots::SV_BotUserMove_Func(Game::client_t*)
|
||||
void Bots::SV_BotUserMove_Func(Game::client_t* cl)
|
||||
{
|
||||
int cl_num = cl - Game::svs->clients;
|
||||
|
||||
Game::usercmd_t cmd = {};
|
||||
cmd.serverTime = Game::svs->time;
|
||||
|
||||
cl->deltaMessage = cl->netchan.outgoingSequence - 1;
|
||||
Game::SV_ClientThink(&cmd, cl);
|
||||
}
|
||||
|
||||
__declspec(naked) void Bots::SV_BotUserMove_Stub()
|
||||
@ -35,6 +41,9 @@ namespace Components
|
||||
|
||||
// hook bot movement
|
||||
Utils::Hook(0x45C210, SV_BotUserMove_Stub, HOOK_JUMP).install()->quick();
|
||||
|
||||
// stop the ping spam
|
||||
Utils::Hook::Nop(0x45BF59, 5);
|
||||
}
|
||||
|
||||
Bots::~Bots()
|
||||
|
@ -5,7 +5,7 @@ namespace Components
|
||||
{
|
||||
HelloWorld::HelloWorld()
|
||||
{
|
||||
MessageBoxA(nullptr, "MP", "DEBUG", 0);
|
||||
//MessageBoxA(nullptr, Utils::String::VA("%d", Game::svs), "DEBUG", 0);
|
||||
}
|
||||
|
||||
HelloWorld::~HelloWorld()
|
||||
|
@ -2,6 +2,32 @@
|
||||
|
||||
namespace Game
|
||||
{
|
||||
clientStatic_t* cls;
|
||||
serverStatic_t* svs;
|
||||
server_t* sv;
|
||||
|
||||
scrCompilePub_t* gScrCompilePub;
|
||||
scrVarPub_t* scrVarPub;
|
||||
scrVmPub_t* scrVmPub;
|
||||
|
||||
cgs_t* cgsArray;
|
||||
cg_t* cgArray;
|
||||
|
||||
centity_s* cg_entitiesArray;
|
||||
|
||||
WeaponDef_t** BG_WeaponNames;
|
||||
|
||||
gentity_t* g_entities;
|
||||
gclient_t* g_clients;
|
||||
|
||||
bgs_s* level_bgs;
|
||||
|
||||
level_locals_t* level;
|
||||
|
||||
stringIndex_t* scr_const;
|
||||
|
||||
bgs_s** bgs_ptr;
|
||||
|
||||
void Init(GAMEEXE)
|
||||
{
|
||||
cls = ASSIGN(clientStatic_t*, 0x68A408);
|
||||
@ -30,5 +56,17 @@ namespace Game
|
||||
|
||||
bgs_ptr = ASSIGN(bgs_s**, 0x19A1C78);
|
||||
}
|
||||
|
||||
void SV_ClientThink(Game::usercmd_s* cmd, Game::client_t* client)
|
||||
{
|
||||
int func_loc = 0x456010;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, client;
|
||||
mov eax, cmd;
|
||||
call func_loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,29 +7,32 @@ namespace Game
|
||||
{
|
||||
void Init(GAMEEXE);
|
||||
|
||||
static clientStatic_t* cls;
|
||||
static serverStatic_t* svs;
|
||||
static server_t* sv;
|
||||
extern clientStatic_t* cls;
|
||||
extern serverStatic_t* svs;
|
||||
extern server_t* sv;
|
||||
|
||||
static scrCompilePub_t* gScrCompilePub;
|
||||
static scrVarPub_t* scrVarPub;
|
||||
static scrVmPub_t* scrVmPub;
|
||||
extern scrCompilePub_t* gScrCompilePub;
|
||||
extern scrVarPub_t* scrVarPub;
|
||||
extern scrVmPub_t* scrVmPub;
|
||||
|
||||
static cgs_t* cgsArray;
|
||||
static cg_t* cgArray;
|
||||
extern cgs_t* cgsArray;
|
||||
extern cg_t* cgArray;
|
||||
|
||||
static centity_s* cg_entitiesArray;
|
||||
extern centity_s* cg_entitiesArray;
|
||||
|
||||
static WeaponDef_t** BG_WeaponNames;
|
||||
extern WeaponDef_t** BG_WeaponNames;
|
||||
|
||||
static gentity_t* g_entities;
|
||||
static gclient_t* g_clients;
|
||||
extern gentity_t* g_entities;
|
||||
extern gclient_t* g_clients;
|
||||
|
||||
static bgs_s* level_bgs;
|
||||
extern bgs_s* level_bgs;
|
||||
|
||||
static level_locals_t* level;
|
||||
extern level_locals_t* level;
|
||||
|
||||
static stringIndex_t* scr_const;
|
||||
extern stringIndex_t* scr_const;
|
||||
|
||||
static bgs_s** bgs_ptr;
|
||||
extern bgs_s** bgs_ptr;
|
||||
|
||||
|
||||
void SV_ClientThink(Game::usercmd_s*, Game::client_t*);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user