From 711d8739158b3ed0cd5c7ef8a652ceafe1564eab Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:17:19 -0600 Subject: [PATCH] Add TESObjectREFR::OpenContainer --- 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 c1418700b..b0b4316bf 100644 --- a/include/RE/T/TESObjectREFR.h +++ b/include/RE/T/TESObjectREFR.h @@ -485,6 +485,7 @@ namespace RE bool MoveToNode(TESObjectREFR* a_target, const BSFixedString& a_nodeName); bool MoveToNode(TESObjectREFR* a_target, NiAVObject* a_node); bool NameIncludes(std::string a_word); + void OpenContainer(std::int32_t a_openType) const; NiPointer PlaceObjectAtMe(TESBoundObject* a_baseToPlace, bool a_forcePersist) const; void PlayAnimation(stl::zstring a_from, stl::zstring a_to); void PlayAnimation(NiControllerManager* a_manager, NiControllerSequence* a_toSeq, NiControllerSequence* a_fromSeq); diff --git a/src/RE/T/TESObjectREFR.cpp b/src/RE/T/TESObjectREFR.cpp index 9d83840dd..9fa6af0f6 100644 --- a/src/RE/T/TESObjectREFR.cpp +++ b/src/RE/T/TESObjectREFR.cpp @@ -790,6 +790,13 @@ namespace RE return name.find(a_word) != std::string::npos; } + void TESObjectREFR::OpenContainer(std::int32_t a_openType) const + { + using func_t = decltype(&TESObjectREFR::OpenContainer); + REL::Relocation func{ RELOCATION_ID(50211, 51140) }; + func(this, a_openType); + } + NiPointer TESObjectREFR::PlaceObjectAtMe(TESBoundObject* a_baseToPlace, bool a_forcePersist) const { const auto handle = TESDataHandler::GetSingleton()->CreateReferenceAtLocation(a_baseToPlace, GetPosition(), GetAngle(), GetParentCell(), GetWorldspace(), nullptr, nullptr, ObjectRefHandle(), a_forcePersist, true);