Skip to content

Commit

Permalink
feat: ProcessLists
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed Oct 3, 2024
1 parent 0d8a711 commit 8281058
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
6 changes: 6 additions & 0 deletions include/RE/IDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
23 changes: 15 additions & 8 deletions include/RE/P/ProcessLists.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,25 @@ namespace RE

[[nodiscard]] static ProcessLists* GetSingleton()
{
static REL::Relocation<ProcessLists**> singleton{ REL::ID(878338) };
static REL::Relocation<ProcessLists**> singleton{ ID::ProcessLists::Singleton };
return *singleton;
}

[[nodiscard]] bool AreHostileActorsNear(BSScrapArray<ActorHandle>* a_hostileActors = nullptr)
{
using func_t = decltype(&ProcessLists::AreHostileActorsNear);
static REL::Relocation<func_t> func{ ID::ProcessLists::AreHostileActorsNear };
return func(this, a_hostileActors);
}

// members
std::byte pad10[0x3B]; // 010
bool runDetection; // 044
std::byte pad45[0x13]; // 045
BSTArray<std::uint32_t> highActorHandles; // 058
BSTArray<std::uint32_t> lowActorHandles; // 068
BSTArray<std::uint32_t> middleHighActorHandles; // 078
BSTArray<std::uint32_t> middleLowActorHandles; // 088
std::byte pad10[0x3B]; // 010
bool runDetection; // 044
std::byte pad45[0x13]; // 045
BSTArray<ActorHandle> highActorHandles; // 058
BSTArray<ActorHandle> lowActorHandles; // 068
BSTArray<ActorHandle> middleHighActorHandles; // 078
BSTArray<ActorHandle> middleLowActorHandles; // 088
};
static_assert(offsetof(ProcessLists, runDetection) == 0x44);
static_assert(offsetof(ProcessLists, highActorHandles) == 0x58);
Expand Down

0 comments on commit 8281058

Please sign in to comment.