From f72f85ecd6215afe7c859d2deb9d68a5fe50bf92 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 9 Mar 2024 15:17:10 +0100 Subject: [PATCH] VC: Fix a stack corruption in ZeroAmmoFix --- SilentPatchVC/SilentPatchVC.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SilentPatchVC/SilentPatchVC.cpp b/SilentPatchVC/SilentPatchVC.cpp index 2edc132..d3604eb 100644 --- a/SilentPatchVC/SilentPatchVC.cpp +++ b/SilentPatchVC/SilentPatchVC.cpp @@ -260,12 +260,12 @@ namespace ZeroAmmoFix { template -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 -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(ped, nullptr, weapon, std::max(1u, ammo)); + orgGiveWeapon(ped, nullptr, weapon, std::max(1u, ammo), flag); } HOOK_EACH_FUNC(GiveWeapon, orgGiveWeapon, GiveWeapon_SP);