From 9854f2235a3452235adf3a45fa77c149515603ac Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 10 Feb 2018 10:56:00 +0100 Subject: [PATCH] III/VC don't need addrvariants --- SilentPatch/MemoryMgr.h | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/SilentPatch/MemoryMgr.h b/SilentPatch/MemoryMgr.h index 465a456..b42be77 100644 --- a/SilentPatch/MemoryMgr.h +++ b/SilentPatch/MemoryMgr.h @@ -376,7 +376,7 @@ namespace Memory #if defined _GTA_III || defined _GTA_VC - inline uintptr_t AddressByVersion(AddrVariant address10, AddrVariant address11, AddrVariant addressSteam) + inline uintptr_t AddressByVersion(uintptr_t address10, uintptr_t address11, uintptr_t addressSteam) { InitializeVersions(); @@ -385,35 +385,20 @@ namespace Memory switch ( bVer ) { case 1: - if ( std::holds_alternative(address11) ) return HandlePattern( std::get(address11) ); - else - { - const uintptr_t addr = std::get(address11); #ifdef assert - assert(addr); + assert(address11); #endif - return addr; - } + return address11; case 2: - if ( std::holds_alternative(addressSteam) ) return HandlePattern( std::get(addressSteam) ); - else - { - const uintptr_t addr = std::get(addressSteam); #ifdef assert - assert(addr); + assert(addressSteam); #endif - return addr; - } + return addressSteam; default: - if ( std::holds_alternative(address10) ) return HandlePattern( std::get(address10) ); - else - { - const uintptr_t addr = std::get(address10); #ifdef assert - assert(addr); + assert(address10); #endif - return addr; - } + return address10; } } @@ -425,7 +410,7 @@ namespace Memory #if defined _GTA_III || defined _GTA_VC template -inline T AddressByVersion(Memory::AddrVariant address10, Memory::AddrVariant address11, Memory::AddrVariant addressSteam) +inline T AddressByVersion(uintptr_t address10, uintptr_t address11, uintptr_t addressSteam) { return T(Memory::internal::AddressByVersion( address10, address11, addressSteam )); }