From 95d6194995da451a502ecb060729ed3915af2f1c Mon Sep 17 00:00:00 2001 From: MartinREVOL Date: Wed, 10 Jun 2026 11:27:48 +0200 Subject: [PATCH 1/2] feat: add IsEssential and SetEssential to TESActorBaseData --- include/RE/T/TESActorBaseData.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/RE/T/TESActorBaseData.h b/include/RE/T/TESActorBaseData.h index 566453c..3312039 100644 --- a/include/RE/T/TESActorBaseData.h +++ b/include/RE/T/TESActorBaseData.h @@ -1,14 +1,11 @@ #pragma once - #include "RE/A/ACTOR_BASE_DATA.h" #include "RE/B/BSTList.h" #include "RE/B/BaseFormComponent.h" - namespace RE { class FACTION_RANK; class TESLevItem; - struct TESActorBaseData : public BaseFormComponent { @@ -16,10 +13,27 @@ namespace RE inline static constexpr auto RTTI = RTTI::TESActorBaseData; inline static constexpr auto VTABLE = VTABLE::TESActorBaseData; + [[nodiscard]] bool IsEssential() const noexcept; + void SetEssential(bool a_value) noexcept; + // members ACTOR_BASE_DATA actorData; // 08 TESLevItem* deathItem; // 18 BSSimpleList factions; // 20 }; static_assert(sizeof(TESActorBaseData) == 0x30); + + inline bool TESActorBaseData::IsEssential() const noexcept + { + return actorData.actorBaseFlags.any(ACTOR_BASE_DATA::Flags::Essential); + } + + inline void TESActorBaseData::SetEssential(bool a_value) noexcept + { + if (a_value) { + actorData.actorBaseFlags.set(ACTOR_BASE_DATA::Flags::Essential); + } else { + actorData.actorBaseFlags.reset(ACTOR_BASE_DATA::Flags::Essential); + } + } } From c79bce3dcbf6d1c6a9e3659e2faaefa4b6e6d938 Mon Sep 17 00:00:00 2001 From: MartinREVOL Date: Wed, 10 Jun 2026 15:56:42 +0200 Subject: [PATCH 2/2] fix: revert whitespace changes --- include/RE/T/TESActorBaseData.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/RE/T/TESActorBaseData.h b/include/RE/T/TESActorBaseData.h index 3312039..d6bc494 100644 --- a/include/RE/T/TESActorBaseData.h +++ b/include/RE/T/TESActorBaseData.h @@ -1,11 +1,14 @@ #pragma once + #include "RE/A/ACTOR_BASE_DATA.h" #include "RE/B/BSTList.h" #include "RE/B/BaseFormComponent.h" + namespace RE { class FACTION_RANK; class TESLevItem; + struct TESActorBaseData : public BaseFormComponent {