From ea2503637539dac6f5064d83fc5aa7f83e73f66f Mon Sep 17 00:00:00 2001 From: NOTPIES Date: Tue, 3 Mar 2026 13:13:58 -0300 Subject: [PATCH] fix: vs2012 building --- Minecraft.World/Hasher.cpp | 4 ++++ Minecraft.World/Player.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Minecraft.World/Hasher.cpp b/Minecraft.World/Hasher.cpp index 45c933f..a058030 100644 --- a/Minecraft.World/Hasher.cpp +++ b/Minecraft.World/Hasher.cpp @@ -20,7 +20,11 @@ wstring Hasher::getHash(wstring &name) //return new BigInteger(1, m.digest()).toString(16); // TODO 4J Stu - Will this hash us with the same distribution as the MD5? +#if _MSC_VER >= 1900 return _toString( std::hash{}( s ) ); +#else + return _toString( stdext::hash_value( s ) ); +#endif //} //catch (NoSuchAlgorithmException e) //{ diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index d4832e4..7bf7714 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -2560,9 +2560,11 @@ int Player::hash_fnct(const shared_ptr k) // TODO 4J Stu - Should we just be using the pointers and hashing them? #ifdef __PS3__ return (int)boost::hash_value( k->name ); // 4J Stu - Names are completely unique? -#else +#elif _MSC_VER >= 1900 return (int)std::hash{}( k->name ); // 4J Stu - Names are completely unique? -#endif //__PS3__ +#else + return (int)stdext::hash_value( k->name ); // 4J Stu - Names are completely unique? +#endif } bool Player::eq_test(const shared_ptr x, const shared_ptr y)