diff --git a/SilentPatch/MemoryMgr.GTA.h b/SilentPatch/MemoryMgr.GTA.h index 1207452..c5ca8f1 100644 --- a/SilentPatch/MemoryMgr.GTA.h +++ b/SilentPatch/MemoryMgr.GTA.h @@ -246,10 +246,10 @@ namespace Memory switch ( bVer ) { case 1: - if ( std::holds_alternative(address11) ) return HandlePattern( std::get(address11) ); + if ( auto pao = std::get_if(&address11) ) return HandlePattern( *pao ); else { - const uintptr_t addr = std::get(address11); + const uintptr_t addr = *std::get_if(&address11); #ifdef assert assert(addr); #endif @@ -262,10 +262,10 @@ namespace Memory return AdjustAddress_11(addr); } case 2: - if ( std::holds_alternative(addressSteam) ) return HandlePattern( std::get(addressSteam) ); + if ( auto pao = std::get_if(&addressSteam) ) return HandlePattern( *pao ); else { - const uintptr_t addr = std::get(addressSteam); + const uintptr_t addr = *std::get_if(&addressSteam); #ifdef assert assert(addr); #endif @@ -278,10 +278,10 @@ namespace Memory case 3: return GetDummy(); case 4: - if ( std::holds_alternative(addressNewsteamR2) ) return HandlePattern( std::get(addressNewsteamR2) ); + if ( auto pao = std::get_if(&addressNewsteamR2) ) return HandlePattern( *pao ); else { - const uintptr_t addr = std::get(addressNewsteamR2); + const uintptr_t addr = *std::get_if(&addressNewsteamR2); #ifdef assert assert(addr); #endif @@ -291,10 +291,10 @@ namespace Memory return DynBaseAddress(addr); } case 5: - if ( std::holds_alternative(addressNewsteamR2_LV) ) return HandlePattern( std::get(addressNewsteamR2_LV) ); + if ( auto pao = std::get_if(&addressNewsteamR2) ) return HandlePattern( *pao ); else { - const uintptr_t addr = std::get(addressNewsteamR2_LV); + const uintptr_t addr = *std::get_if(&addressNewsteamR2_LV); #ifdef assert assert(addr); #endif @@ -304,10 +304,10 @@ namespace Memory return DynBaseAddress(addr); } default: - if ( std::holds_alternative(address10) ) return HandlePattern( std::get(address10) ); + if ( auto pao = std::get_if(&address10) ) return HandlePattern( *pao ); else { - const uintptr_t addr = std::get(address10); + const uintptr_t addr = *std::get_if(&address10); #ifdef assert assert(addr); #endif