From d06092de80004e8cd9bc27a87d19a42e1aacff1c Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 6 Feb 2023 12:50:40 +0000 Subject: [PATCH] [ScriptError]: Use macro I forgot about (#754) --- src/Components/Modules/GSC/ScriptError.cpp | 2 +- src/Game/Functions.cpp | 2 ++ src/Game/Functions.hpp | 3 +++ src/Game/Script.cpp | 1 + src/Game/Script.hpp | 3 +++ src/Game/Server.cpp | 2 ++ src/Game/Server.hpp | 6 ++++++ 7 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/GSC/ScriptError.cpp b/src/Components/Modules/GSC/ScriptError.cpp index 69303d3e..17f7570e 100644 --- a/src/Components/Modules/GSC/ScriptError.cpp +++ b/src/Components/Modules/GSC/ScriptError.cpp @@ -221,7 +221,7 @@ namespace Components } } - assert(0 && "unreachable"); + AssertUnreachable; return nullptr; } diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index 04c5a2e6..0194f315 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -256,6 +256,8 @@ namespace Game LargeLocalBeginRight_t LargeLocalBeginRight = LargeLocalBeginRight_t(0x644140); LargeLocalReset_t LargeLocalReset = LargeLocalReset_t(0x430630); + StructuredDataDef_GetAsset_t StructuredDataDef_GetAsset = StructuredDataDef_GetAsset_t(0x4D5C50); + longjmp_internal_t longjmp_internal = longjmp_internal_t(0x6B8898); CmdArgs* cmd_args = reinterpret_cast(0x1AAC5D0); diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index 736e4eea..a372c155 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -587,6 +587,9 @@ namespace Game typedef void(*LargeLocalReset_t)(); extern LargeLocalReset_t LargeLocalReset; + typedef StructuredDataDef*(*StructuredDataDef_GetAsset_t)(const char* filename, unsigned int maxSize); + extern StructuredDataDef_GetAsset_t StructuredDataDef_GetAsset; + typedef void(*longjmp_internal_t)(jmp_buf env, int status); extern longjmp_internal_t longjmp_internal; diff --git a/src/Game/Script.cpp b/src/Game/Script.cpp index a96b5796..30e74319 100644 --- a/src/Game/Script.cpp +++ b/src/Game/Script.cpp @@ -49,6 +49,7 @@ namespace Game Scr_Notify_t Scr_Notify = Scr_Notify_t(0x4A4750); Scr_NotifyLevel_t Scr_NotifyLevel = Scr_NotifyLevel_t(0x4D9C30); + Scr_ErrorInternal_t Scr_ErrorInternal = Scr_ErrorInternal_t(0x61DB10); Scr_Error_t Scr_Error = Scr_Error_t(0x61E8B0); Scr_ObjectError_t Scr_ObjectError = Scr_ObjectError_t(0x42EF40); Scr_ParamError_t Scr_ParamError = Scr_ParamError_t(0x4FBC70); diff --git a/src/Game/Script.hpp b/src/Game/Script.hpp index 5693ce72..3748419a 100644 --- a/src/Game/Script.hpp +++ b/src/Game/Script.hpp @@ -143,6 +143,9 @@ namespace Game typedef int(*Scr_GetPointerType_t)(unsigned int index); extern Scr_GetPointerType_t Scr_GetPointerType; + typedef void(*Scr_ErrorInternal_t)(); + extern Scr_ErrorInternal_t Scr_ErrorInternal; + typedef void(*Scr_Error_t)(const char* error); extern Scr_Error_t Scr_Error; diff --git a/src/Game/Server.cpp b/src/Game/Server.cpp index c64f5811..448b5c00 100644 --- a/src/Game/Server.cpp +++ b/src/Game/Server.cpp @@ -20,6 +20,8 @@ namespace Game SV_GetPlayerByNum_t SV_GetPlayerByNum = SV_GetPlayerByNum_t(0x624390); SV_FindClientByAddress_t SV_FindClientByAddress = SV_FindClientByAddress_t(0x44F450); SV_WaitServer_t SV_WaitServer = SV_WaitServer_t(0x4256F0); + SV_GetClientPersistentDataBuffer_t SV_GetClientPersistentDataBuffer = SV_GetClientPersistentDataBuffer_t(0x4014C0); + SV_GetClientPersistentDataModifiedFlags_t SV_GetClientPersistentDataModifiedFlags = SV_GetClientPersistentDataModifiedFlags_t(0x4F4AC0); int* svs_time = reinterpret_cast(0x31D9384); int* sv_timeResidual = reinterpret_cast(0x2089E14); diff --git a/src/Game/Server.hpp b/src/Game/Server.hpp index 8fd62bba..b507c417 100644 --- a/src/Game/Server.hpp +++ b/src/Game/Server.hpp @@ -56,6 +56,12 @@ namespace Game typedef void(*SV_WaitServer_t)(); extern SV_WaitServer_t SV_WaitServer; + typedef char*(*SV_GetClientPersistentDataBuffer_t)(int clientNum); + extern SV_GetClientPersistentDataBuffer_t SV_GetClientPersistentDataBuffer; + + typedef char*(*SV_GetClientPersistentDataModifiedFlags_t)(int clientNum); + extern SV_GetClientPersistentDataModifiedFlags_t SV_GetClientPersistentDataModifiedFlags; + constexpr auto MAX_STATPACKETS = 7; extern int* svs_time;