From 82810583c4956748969212299148a7a4ab7c62db Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:58:38 -0500 Subject: [PATCH] feat: `ProcessLists` --- include/RE/IDs.h | 6 ++++++ include/RE/P/ProcessLists.h | 23 +++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/include/RE/IDs.h b/include/RE/IDs.h index 10db27c6..7d1e9aca 100644 --- a/include/RE/IDs.h +++ b/include/RE/IDs.h @@ -283,6 +283,12 @@ namespace RE::ID inline constexpr REL::ID singleton{ 865059 }; } + namespace ProcessLists + { + inline constexpr REL::ID AreHostileActorsNear{ 154040 }; + inline constexpr REL::ID Singleton{ 878338 }; + } + namespace REFR_LOCK { inline constexpr REL::ID GetLockLevel{ 84103 }; diff --git a/include/RE/P/ProcessLists.h b/include/RE/P/ProcessLists.h index 77fe46fa..b39f8ea2 100644 --- a/include/RE/P/ProcessLists.h +++ b/include/RE/P/ProcessLists.h @@ -22,18 +22,25 @@ namespace RE [[nodiscard]] static ProcessLists* GetSingleton() { - static REL::Relocation singleton{ REL::ID(878338) }; + static REL::Relocation singleton{ ID::ProcessLists::Singleton }; return *singleton; } + [[nodiscard]] bool AreHostileActorsNear(BSScrapArray* a_hostileActors = nullptr) + { + using func_t = decltype(&ProcessLists::AreHostileActorsNear); + static REL::Relocation func{ ID::ProcessLists::AreHostileActorsNear }; + return func(this, a_hostileActors); + } + // members - std::byte pad10[0x3B]; // 010 - bool runDetection; // 044 - std::byte pad45[0x13]; // 045 - BSTArray highActorHandles; // 058 - BSTArray lowActorHandles; // 068 - BSTArray middleHighActorHandles; // 078 - BSTArray middleLowActorHandles; // 088 + std::byte pad10[0x3B]; // 010 + bool runDetection; // 044 + std::byte pad45[0x13]; // 045 + BSTArray highActorHandles; // 058 + BSTArray lowActorHandles; // 068 + BSTArray middleHighActorHandles; // 078 + BSTArray middleLowActorHandles; // 088 }; static_assert(offsetof(ProcessLists, runDetection) == 0x44); static_assert(offsetof(ProcessLists, highActorHandles) == 0x58);