From 4cc912af9393fe5278031e692b4a54369caa7768 Mon Sep 17 00:00:00 2001 From: yamashi Date: Mon, 29 Mar 2021 22:04:09 +0200 Subject: [PATCH] 1.2 patch --- src/Image.cpp | 3 +++ src/Image.h | 4 ++-- src/scripting/Scripting.cpp | 3 ++- vendor/RED4ext.SDK | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Image.cpp b/src/Image.cpp index ddad54c7..70c9f9b0 100644 --- a/src/Image.cpp +++ b/src/Image.cpp @@ -18,6 +18,7 @@ void Image::Initialize() static uint8_t s_Guid110[] = { 0xE0, 0xC2, 0x94, 0x64, 0x5C, 0xB4, 0x32, 0x45, 0x95, 0x10, 0x09, 0xA1, 0x0F, 0xB2, 0x53, 0xF8 }; static uint8_t s_Guid111[] = { 0x8C, 0x13, 0x59, 0xA9, 0x7E, 0x6E, 0x49, 0x4F, 0x82, 0xF9, 0xCF, 0x58, 0x71, 0x6B, 0x7D, 0x3A }; static uint8_t s_Guid112[] = { 0x7B, 0x51, 0xF5, 0x2C, 0x87, 0xD0, 0xFF, 0x40, 0x83, 0xE5, 0xAA, 0x6C, 0x07, 0xE9, 0x95, 0x20 }; + static uint8_t s_Guid120[] = { 0x17, 0x1B, 0x2C, 0x4A, 0xC7, 0xA5, 0x38, 0x49, 0x8C, 0x43, 0x20, 0xFC, 0x47, 0x14, 0xF2, 0x33 }; mem::module mainModule = mem::module::main(); @@ -61,6 +62,8 @@ void Image::Initialize() version = MakeVersion(1, 11); else if (memcmp(&pdb_info->Guid, s_Guid112, 16) == 0) version = MakeVersion(1, 12); + else if (memcmp(&pdb_info->Guid, s_Guid120, 16) == 0) + version = MakeVersion(1, 20); else { for (auto c : pdb_info->Guid) diff --git a/src/Image.h b/src/Image.h index d6edb8bb..6ecaf577 100644 --- a/src/Image.h +++ b/src/Image.h @@ -6,7 +6,7 @@ struct Image static std::tuple GetSupportedVersion() noexcept { - return std::make_tuple(1, 12); + return std::make_tuple(1, 20); } static uint64_t MakeVersion(uint32_t aMajor, uint16_t aMinor) noexcept @@ -14,7 +14,7 @@ struct Image return static_cast(aMajor) << 32 | static_cast(aMinor) << 16; } - std::tuple GetVersion() const noexcept + [[nodiscard]] std::tuple GetVersion() const noexcept { return std::make_tuple(static_cast(version >> 32), static_cast((version >> 16) & 0xFFFF)); } diff --git a/src/scripting/Scripting.cpp b/src/scripting/Scripting.cpp index 38cacb7b..0586cc8c 100644 --- a/src/scripting/Scripting.cpp +++ b/src/scripting/Scripting.cpp @@ -848,7 +848,8 @@ sol::protected_function Scripting::InternalIndex(const std::string& acName, sol: auto obj = make_object(state, [this, name = acName](sol::variadic_args aArgs, sol::this_environment aThisEnv, sol::this_state aState) { std::string result; - auto code = this->Execute(name, aArgs, result, aState); + auto code = this->Execute(name, aArgs, result, aState); + if(!code) { const sol::environment cEnv = aThisEnv; diff --git a/vendor/RED4ext.SDK b/vendor/RED4ext.SDK index 23a6f6ff..6438a96c 160000 --- a/vendor/RED4ext.SDK +++ b/vendor/RED4ext.SDK @@ -1 +1 @@ -Subproject commit 23a6f6ffa0671ec1b4849d852d4625f1257110d9 +Subproject commit 6438a96c0fe1e6e00a2815c97bbf51b1b0bdc9ee