VC: Fix a stack corruption in ZeroAmmoFix

This commit is contained in:
Silent 2024-03-09 15:17:10 +01:00
parent ac3601e12c
commit f72f85ecd6
No known key found for this signature in database
GPG Key ID: AE53149BB0C45AF1

View File

@ -260,12 +260,12 @@ namespace ZeroAmmoFix
{
template<std::size_t Index>
static void (__fastcall *orgGiveWeapon)(void* ped, void*, unsigned int weapon, unsigned int ammo);
static void (__fastcall *orgGiveWeapon)(void* ped, void*, unsigned int weapon, unsigned int ammo, bool flag);
template<std::size_t Index>
static void __fastcall GiveWeapon_SP(void* ped, void*, unsigned int weapon, unsigned int ammo)
static void __fastcall GiveWeapon_SP(void* ped, void*, unsigned int weapon, unsigned int ammo, bool flag)
{
orgGiveWeapon<Index>(ped, nullptr, weapon, std::max(1u, ammo));
orgGiveWeapon<Index>(ped, nullptr, weapon, std::max(1u, ammo), flag);
}
HOOK_EACH_FUNC(GiveWeapon, orgGiveWeapon, GiveWeapon_SP);