From 92fcc63d3d1433aa7e02f0c772d0c8d47022198d Mon Sep 17 00:00:00 2001 From: yamashi Date: Wed, 16 Feb 2022 00:48:55 +0100 Subject: [PATCH] make sure game doesn't crash due to spawn not working --- src/reverse/RTTIExtender.cpp | 5 ++++- vendor/luasocket | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 160000 vendor/luasocket diff --git a/src/reverse/RTTIExtender.cpp b/src/reverse/RTTIExtender.cpp index 3569ce57..53feac2c 100644 --- a/src/reverse/RTTIExtender.cpp +++ b/src/reverse/RTTIExtender.cpp @@ -169,6 +169,7 @@ struct TEMP_PendingEntity virtual void AddRef() = 0; }; RED4EXT_ASSERT_OFFSET(Unk00, entityID, 0x110); + RED4EXT_ASSERT_OFFSET(Unk00, entity, 0x118); Unk00* unk00; uint64_t unk08; @@ -530,7 +531,9 @@ struct exEntitySpawnerSystem : gameIGameSystem }; auto* pGameInstance = Singleton->gameInstance; - func(reinterpret_cast(pGameInstance->unk78)->unk00->worldRuntimeEntityRegistry, aUnk.entity); + + if (aUnk.entity) + func(reinterpret_cast(pGameInstance->unk78)->unk00->worldRuntimeEntityRegistry, aUnk.entity); } public: diff --git a/vendor/luasocket b/vendor/luasocket deleted file mode 160000 index 5b18e475..00000000 --- a/vendor/luasocket +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b18e475f38fcf28429b1cc4b17baee3b9793a62