From d270e08a22dfa02b3df1735afa47d3e8a94ad587 Mon Sep 17 00:00:00 2001 From: ineedbots Date: Mon, 28 Jun 2021 22:35:58 -0600 Subject: [PATCH] Fix edx and __cdecl bug --- src/Components/Modules/Bots.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index 2f2eb93..c353691 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -58,9 +58,12 @@ namespace Components } } - void Bots::PlayerCmd_setSpawnWeapon_Func(Game::gentity_t* ent, int wpIdx) + void __cdecl Bots::PlayerCmd_setSpawnWeapon_Func(Game::gentity_t* ent, int wpIdx) { - + if (Game::svs->clients[ent->s.number].bot) + { + + } } __declspec(naked) void Bots::PlayerCmd_setSpawnWeapon_Stub() @@ -70,7 +73,8 @@ namespace Components push edx; push esi; call PlayerCmd_setSpawnWeapon_Func; - add esp, 8; + add esp, 4; + pop edx; // __cdecl reqires edx be caller saved // go back mov eax, [esi + 0x158];