From 7e55b89ac555612b060ffd4fc68a29eca0cac575 Mon Sep 17 00:00:00 2001 From: powerof3 <32599957+powerof3@users.noreply.github.com> Date: Mon, 17 Jun 2024 00:33:47 +0530 Subject: [PATCH] Add `TESObjectREFR::GetEncounterZone` --- include/RE/T/TESObjectREFR.h | 1 + src/RE/T/TESObjectREFR.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/RE/T/TESObjectREFR.h b/include/RE/T/TESObjectREFR.h index 0365eb422..cad1d4ad8 100644 --- a/include/RE/T/TESObjectREFR.h +++ b/include/RE/T/TESObjectREFR.h @@ -376,6 +376,7 @@ namespace RE const char* GetDisplayFullName(); InventoryDropMap GetDroppedInventory(); InventoryDropMap GetDroppedInventory(std::function a_filter); + BGSEncounterZone* GetEncounterZone() const; BGSLocation* GetEditorLocation() const; bool GetEditorLocation(NiPoint3& a_outPos, NiPoint3& a_outRot, TESForm*& a_outWorldOrCell, TESObjectCELL* a_fallback); std::optional GetEnchantmentCharge() const; diff --git a/src/RE/T/TESObjectREFR.cpp b/src/RE/T/TESObjectREFR.cpp index 219efe936..aac465ae5 100644 --- a/src/RE/T/TESObjectREFR.cpp +++ b/src/RE/T/TESObjectREFR.cpp @@ -251,6 +251,13 @@ namespace RE return results; } + BGSEncounterZone* TESObjectREFR::GetEncounterZone() const + { + using func_t = decltype(&TESObjectREFR::GetEncounterZone); + REL::Relocation func{ RELOCATION_ID(19797, 20202) }; + return func(this); + } + BGSLocation* TESObjectREFR::GetEditorLocation() const { return GetEditorLocation1();