From 5f4cb4024497417a07725ba5cbb00b888fe02145 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 2 Feb 2017 00:19:18 +0100 Subject: [PATCH] [Weapon] Fix weapon string reallocation --- src/Components/Modules/Weapon.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Components/Modules/Weapon.cpp b/src/Components/Modules/Weapon.cpp index e95d9bf1..0cd51357 100644 --- a/src/Components/Modules/Weapon.cpp +++ b/src/Components/Modules/Weapon.cpp @@ -78,14 +78,15 @@ namespace Components Utils::Hook::Set(0x57B7D1, bg_weapAmmoTypes); Utils::Hook::Set(0x57B7DA, bg_weapAmmoTypes); -// static int weaponStrings[WEAPON_LIMIT * 2]; // string + hash -// Utils::Hook::Set(0x504E01, sizeof(weaponStrings)); -// Utils::Hook::Set(0x4C77DC, sizeof(weaponStrings)); -// Utils::Hook::Set(0x4B72DC, weaponStrings); -// Utils::Hook::Set(0x4C77E2, weaponStrings); -// Utils::Hook::Set(0x504E08, weaponStrings); -// Utils::Hook::Set(0x795584, weaponStrings); -// Utils::Hook::Set(0x4B72E8, &weaponStrings[1]); + static int weaponStrings[WEAPON_LIMIT * 2]; // string + hash + Utils::Hook::Set(0x504E01, sizeof(weaponStrings)); + Utils::Hook::Set(0x4C77DC, sizeof(weaponStrings)); + Utils::Hook::Set(0x4B72DC, weaponStrings); + Utils::Hook::Set(0x4C77E2, weaponStrings); + Utils::Hook::Set(0x504E08, weaponStrings); + Utils::Hook::Set(0x795584, weaponStrings); + Utils::Hook::Set(0x7955FC, weaponStrings); + Utils::Hook::Set(0x4B72E8, &weaponStrings[1]); // Patch bg_weaponDefs on the stack