Skip to content

Commit

Permalink
Add ExtraDataList::HasQuestObjectAlias
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Jan 26, 2024
1 parent 767d6ba commit 23abe97
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/RE/E/ExtraDataList.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ namespace RE
TESForm* GetOwner();
SOUL_LEVEL GetSoulLevel() const;
ObjectRefHandle GetTeleportLinkedDoor();
bool HasQuestObjectAlias();
void SetCount(std::uint16_t a_count);
void SetEncounterZone(BGSEncounterZone* a_zone);
void SetExtraFlags(ExtraFlags::Flag a_flags, bool a_enable);
Expand Down
9 changes: 8 additions & 1 deletion src/RE/E/ExtraDataList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,14 @@ namespace RE
ObjectRefHandle();
}

void ExtraDataList::SetCount(std::uint16_t a_count)
bool ExtraDataList::HasQuestObjectAlias()
{
using func_t = decltype(&ExtraDataList::HasQuestObjectAlias);
REL::Relocation<func_t> func{ RELOCATION_ID(11913, 12052) };
return func(this);
}

void ExtraDataList::SetCount(std::uint16_t a_count)
{
using func_t = decltype(&ExtraDataList::SetCount);
REL::Relocation<func_t> func{ Offset::ExtraDataList::SetCount };
Expand Down
12 changes: 9 additions & 3 deletions src/RE/I/InventoryEntryData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,15 @@ namespace RE

bool InventoryEntryData::IsQuestObject() const
{
using func_t = decltype(&InventoryEntryData::IsQuestObject);
REL::Relocation<func_t> func{ RELOCATION_ID(15767, 16005) };
return func(this);
if (extraLists) {
for (const auto& xList : *extraLists) {
if (xList && xList->HasQuestObjectAlias()) {
return true;
}
}
}

return false;
}

void InventoryEntryData::PoisonObject(AlchemyItem* a_alchItem, std::uint32_t a_count)
Expand Down

0 comments on commit 23abe97

Please sign in to comment.