From 547fec18bd2f519765a98990ecda5119ac44f4f9 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Mon, 6 Feb 2017 19:29:49 +0100 Subject: [PATCH] [Weapon] Fix killicons --- src/Components/Modules/Weapon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/Weapon.cpp b/src/Components/Modules/Weapon.cpp index 4879db3f..7251cea5 100644 --- a/src/Components/Modules/Weapon.cpp +++ b/src/Components/Modules/Weapon.cpp @@ -260,6 +260,8 @@ namespace Components Utils::Hook::Set(0x5F7187, WEAPON_LIMIT); Utils::Hook::Set(0x5FECF9, WEAPON_LIMIT); + Utils::Hook::Set(0x586CC3, -(WEAPON_LIMIT)); + // Reference: https://courses.engr.illinois.edu/ece390/books/artofasm/CH09/CH09-6.html (See 9.5.2 Division Without DIV and IDIV) // And http://reverseengineering.stackexchange.com/questions/1397/how-can-i-reverse-optimized-integer-division-modulo-by-constant-operations // The game's magic number is computed using this formula: (1 / 1200) * (2 ^ (32 + 7) @@ -375,7 +377,6 @@ namespace Components Utils::Hook::Set(0x59C095, cg_weaponsStaticArray); Utils::Hook::Set(0x59C09D, cg_weaponsStaticArray); - // TODO: Check the offsets, icons are still wrong, but at least crashes are 'fixed' static int unknownMaterialArray[WEAPON_LIMIT + 4]; Utils::Hook::Set(0x58D003, unknownMaterialArray); Utils::Hook::Set(0x58969A, &unknownMaterialArray[3]);