From 5df90c582980d8472965adaa160f888066b0e73d Mon Sep 17 00:00:00 2001 From: powerof3 Date: Fri, 18 Oct 2024 15:43:50 +0530 Subject: [PATCH] Add `TESNPC::GetUniqueActor` --- include/RE/T/TESNPC.h | 1 + src/RE/T/TESNPC.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/RE/T/TESNPC.h b/include/RE/T/TESNPC.h index e6b6cabf7..e319dda92 100644 --- a/include/RE/T/TESNPC.h +++ b/include/RE/T/TESNPC.h @@ -251,6 +251,7 @@ namespace RE TESNPC* GetRootFaceNPC(); [[nodiscard]] const TESNPC* GetRootFaceNPC() const; [[nodiscard]] SEX GetSex() const; + Actor* GetUniqueActor(); bool HasApplicableKeywordString(std::string_view a_editorID); bool HasOverlays(); bool IsInFaction(TESFaction* a_faction) const; diff --git a/src/RE/T/TESNPC.cpp b/src/RE/T/TESNPC.cpp index 863d50de0..761bf1a59 100644 --- a/src/RE/T/TESNPC.cpp +++ b/src/RE/T/TESNPC.cpp @@ -91,6 +91,13 @@ namespace RE return IsFemale() ? SEX::kFemale : SEX::kMale; } + Actor* TESNPC::GetUniqueActor() + { + using func_t = decltype(&TESNPC::GetUniqueActor); + static REL::Relocation func{ RELOCATION_ID(24180, 24684) }; + return func(this); + } + BGSHeadPart* TESNPC::GetCurrentHeadPartByType(HeadPartType a_type) { return HasOverlays() ? GetHeadPartOverlayByType(a_type) : GetHeadPartByType(a_type);