Skip to content

Commit

Permalink
feat: misc (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix authored Oct 3, 2024
1 parent e90b4a7 commit 12d5414
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 9 deletions.
1 change: 1 addition & 0 deletions include/RE/A/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ namespace RE
virtual void Unk_1A0(); // 1A0
virtual void Unk_1A1(); // 1A1

void EvaluatePackage(bool a_immediate = false, bool a_resetAI = false);
[[nodiscard]] bool IsHostileToActor(Actor* a_actor);

// members
Expand Down
1 change: 1 addition & 0 deletions include/RE/B/BSCoreTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ namespace RE
{
using TESFormID = std::uint32_t;
using RefHandle = std::uint32_t;
using ActorHandle = std::uint32_t;
}
4 changes: 3 additions & 1 deletion include/RE/I/IAnimationGraphManagerHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

namespace RE
{
class IAnimationGraphManagerHolder
class __declspec(novtable) IAnimationGraphManagerHolder
{
public:
SF_RTTI(IAnimationGraphManagerHolder);

virtual ~IAnimationGraphManagerHolder(); // 00

// add
Expand Down
1 change: 1 addition & 0 deletions include/RE/I/IBGSBaseFormData.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace RE
{
class TESFile;
class TESForm;

class IBGSBaseFormData
Expand Down
14 changes: 14 additions & 0 deletions include/RE/IDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace RE::ID
{
namespace Actor
{
inline constexpr REL::ID EvaluatePackage{ 150640 };
inline constexpr REL::ID IsHostileToActor{ 150777 };
}

Expand Down Expand Up @@ -282,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 Expand Up @@ -383,9 +390,11 @@ namespace RE::ID
inline constexpr REL::ID AddLockChange{ 106386 };
inline constexpr REL::ID GetCalcLevel{ 107531 };
inline constexpr REL::ID GetCurrentLocation{ 106554 };
inline constexpr REL::ID GetDistance{ 106562 };
inline constexpr REL::ID GetLinkedRef{ 107578 };
inline constexpr REL::ID GetLock{ 107581 };
inline constexpr REL::ID GetParentWorldSpace{ 106696 };
inline constexpr REL::ID GetScale{ 106658 };
inline constexpr REL::ID GetSpaceship{ 173851 };
inline constexpr REL::ID GetSpaceshipParentDock{ 174134 };
inline constexpr REL::ID GetSpaceshipPilot{ 173834 };
Expand All @@ -398,6 +407,11 @@ namespace RE::ID
inline constexpr REL::ID IsSpaceshipLanded{ 173880 };
}

namespace TESQuest
{
inline constexpr REL::ID IsStageDone{ 112585 };
}

namespace TESWorldSpace
{
inline constexpr REL::ID GetLocationFromCoordinates{ 107914 };
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
2 changes: 2 additions & 0 deletions include/RE/T/TESForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ namespace RE
{
kDeleted = 1 << 5,
kPersistent = 1 << 10,
kDisabled = 1 << 11,
};

~TESForm() override; // 00
Expand Down Expand Up @@ -219,6 +220,7 @@ namespace RE
[[nodiscard]] bool IsCredits() const noexcept { return GetFormID() == 0x0000000F; }
[[nodiscard]] bool IsDeleted() const noexcept { return GetFormFlags().all(FormFlags::kDeleted); }
[[nodiscard]] bool IsDigiPick() const noexcept { return GetFormID() == 0x0000000A; }
[[nodiscard]] bool IsDisabled() const noexcept { return GetFormFlags().all(FormFlags::kDisabled); }

[[nodiscard]] bool IsNot(FormType a_type) const noexcept { return !Is(a_type); }

Expand Down
2 changes: 2 additions & 0 deletions include/RE/T/TESObjectREFR.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ namespace RE
[[nodiscard]] TESBoundObject* GetBaseObject() { return data.objectReference.get(); }
[[nodiscard]] const TESBoundObject* GetBaseObject() const { return data.objectReference.get(); }
[[nodiscard]] BGSLocation* GetCurrentLocation();
[[nodiscard]] float GetDistance(NiPointer<TESObjectREFR> a_other, bool a_disabledRefs = false, bool a_ignoreWorldspace = false) const;
[[nodiscard]] TESObjectREFR* GetLinkedRef(BGSKeyword* a_keyword);
[[nodiscard]] REFR_LOCK* GetLock() const;
[[nodiscard]] LOCK_LEVEL GetLockLevel() const;
Expand All @@ -377,6 +378,7 @@ namespace RE
[[nodiscard]] constexpr float GetPositionX() const noexcept { return data.location.x; }
[[nodiscard]] constexpr float GetPositionY() const noexcept { return data.location.y; }
[[nodiscard]] constexpr float GetPositionZ() const noexcept { return data.location.z; }
[[nodiscard]] float GetScale() const;
[[nodiscard]] TESObjectREFR* GetSpaceship(bool a_arg1 = true);
[[nodiscard]] TESObjectREFR* GetSpaceshipParentDock();
[[nodiscard]] Actor* GetSpaceshipPilot();
Expand Down
7 changes: 7 additions & 0 deletions include/RE/T/TESQuest.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ namespace RE

~TESQuest() override; // 00

[[nodiscard]] bool IsStageDone(std::uint16_t a_stage) const
{
using func_t = decltype(&TESQuest::IsStageDone);
static REL::Relocation<func_t> func{ ID::TESQuest::IsStageDone };
return func(this, a_stage);
}

// members
std::byte pad38[0xD6]; // 038
QUEST_DATA data; // 108
Expand Down
7 changes: 7 additions & 0 deletions src/RE/A/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

namespace RE
{
void Actor::EvaluatePackage(bool a_immediate, bool a_resetAI)
{
using func_t = decltype(&Actor::EvaluatePackage);
static REL::Relocation<func_t> func{ ID::Actor::EvaluatePackage };
return func(this, a_immediate, a_resetAI);
}

bool Actor::IsHostileToActor(Actor* a_actor)
{
using func_t = decltype(&Actor::IsHostileToActor);
Expand Down
14 changes: 14 additions & 0 deletions src/RE/T/TESObjectREFR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ namespace RE
return func(this);
}

float TESObjectREFR::GetDistance(NiPointer<TESObjectREFR> a_other, bool a_disabledRefs, bool a_ignoreWorldspace) const
{
using func_t = decltype(&TESObjectREFR::GetDistance);
static REL::Relocation<func_t> func{ ID::TESObjectREFR::GetDistance };
return func(this, a_other, a_disabledRefs, a_ignoreWorldspace);
}

TESObjectREFR* TESObjectREFR::GetLinkedRef(BGSKeyword* a_keyword)
{
using func_t = decltype(&TESObjectREFR::GetLinkedRef);
Expand Down Expand Up @@ -70,6 +77,13 @@ namespace RE
return func(this);
}

float TESObjectREFR::GetScale() const
{
using func_t = decltype(&TESObjectREFR::GetScale);
static REL::Relocation<func_t> func{ ID::TESObjectREFR::GetScale };
return func(this);
}

TESObjectREFR* TESObjectREFR::GetSpaceship(bool a_arg1)
{
using func_t = decltype(&TESObjectREFR::GetSpaceship);
Expand Down

0 comments on commit 12d5414

Please sign in to comment.