From 2a5cbf9b22c25c7e8cddb0ad21aa4c06d0c01d52 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:56:20 +0200 Subject: [PATCH] Switch to uint32_t for script checksums Crc32 is unsigned int (32-bit). --- r5dev/squirrel/sqinit.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/r5dev/squirrel/sqinit.h b/r5dev/squirrel/sqinit.h index 1240075a..8cee1b56 100644 --- a/r5dev/squirrel/sqinit.h +++ b/r5dev/squirrel/sqinit.h @@ -9,10 +9,10 @@ inline auto RestoreRemoteChecksumsFromSaveGame = p_RestoreRemoteChecksumsFromSav /* CHANGE THESE WHEN SWITCHING TO PYLONV2 TO UNSIGNED AGAIN!*/ #ifndef CLIENT_DLL -inline int32_t* g_nServerRemoteChecksum = nullptr; +inline uint32_t* g_nServerRemoteChecksum = nullptr; #endif // !CLIENT_DLL #ifndef DEDICATED -inline int32_t* g_nClientRemoteChecksum = nullptr; +inline uint32_t* g_nClientRemoteChecksum = nullptr; #endif // !DEDICATED namespace VSquirrel @@ -78,10 +78,10 @@ class VSqInit : public IDetour virtual void GetVar(void) const { #ifndef CLIENT_DLL - g_nServerRemoteChecksum = p_RestoreRemoteChecksumsFromSaveGame.Offset(0x1C0).FindPatternSelf("48 8D 15", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast(); + g_nServerRemoteChecksum = p_RestoreRemoteChecksumsFromSaveGame.Offset(0x1C0).FindPatternSelf("48 8D 15", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast(); #endif // !CLIENT_DLL #ifndef DEDICATED - g_nClientRemoteChecksum = p_Script_Remote_BeginRegisteringFunctions.Offset(0x0).FindPatternSelf("89 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast(); + g_nClientRemoteChecksum = p_Script_Remote_BeginRegisteringFunctions.Offset(0x0).FindPatternSelf("89 05", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).RCast(); #endif // !DEDICATED } virtual void GetCon(void) const { }