diff --git a/include/RE/A/AIProcess.h b/include/RE/A/AIProcess.h index 30814c154..550d3ef4c 100644 --- a/include/RE/A/AIProcess.h +++ b/include/RE/A/AIProcess.h @@ -134,6 +134,13 @@ namespace RE }; using Hand = Hands::Hand; + struct EquippedObject + { + TESForm* object; // 00 + BGSEquipSlot* slot; // 08 + }; + static_assert(sizeof(EquippedObject) == 0x10); + struct Data0B8 { public: @@ -202,7 +209,7 @@ namespace RE float deathTime; // 094 float trackedDamage; // 098 std::uint32_t pad09C; // 09C - BSTArray forms; // 0A0 + BSTArray equippedForms; // 0A0 Data0B8 unk0B8; // 0B8 TESForm* equippedObjects[Hand::kTotal]; // 0F0 std::uint64_t unk100; // 100 diff --git a/include/RE/A/Actor.h b/include/RE/A/Actor.h index f897e7953..cbf210e86 100644 --- a/include/RE/A/Actor.h +++ b/include/RE/A/Actor.h @@ -528,6 +528,7 @@ namespace RE const TESShout* GetCurrentShout() const; InventoryEntryData* GetEquippedEntryData(bool a_leftHand) const; TESForm* GetEquippedObject(bool a_leftHand) const; + TESForm* GetEquippedObjectInSlot(const BGSEquipSlot* slot) const; float GetEquippedWeight(); std::int32_t GetFactionRank(TESFaction* a_faction, bool a_isPlayer); std::int32_t GetGoldAmount(bool a_noInit = false); diff --git a/src/RE/A/Actor.cpp b/src/RE/A/Actor.cpp index 239ad8c47..3ef846858 100644 --- a/src/RE/A/Actor.cpp +++ b/src/RE/A/Actor.cpp @@ -396,6 +396,21 @@ namespace RE } } + TESForm* Actor::GetEquippedObjectInSlot(const BGSEquipSlot* slot) const + { + if (!currentProcess) { + return nullptr; + } + + for (const auto& equippedObject : currentProcess->equippedForms) { + if (equippedObject.slot == slot) { + return equippedObject.object; + } + } + + return nullptr; + } + float Actor::GetEquippedWeight() { if (equippedWeight < 0.0f) {