Fix edx and __cdecl bug

This commit is contained in:
ineedbots 2021-06-28 22:35:58 -06:00
parent 38adae2c75
commit d270e08a22

View File

@ -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() __declspec(naked) void Bots::PlayerCmd_setSpawnWeapon_Stub()
@ -70,7 +73,8 @@ namespace Components
push edx; push edx;
push esi; push esi;
call PlayerCmd_setSpawnWeapon_Func; call PlayerCmd_setSpawnWeapon_Func;
add esp, 8; add esp, 4;
pop edx; // __cdecl reqires edx be caller saved
// go back // go back
mov eax, [esi + 0x158]; mov eax, [esi + 0x158];