Skip to content

Commit

Permalink
Added also an NPC's baseTemplateForm to list of IDs.
Browse files Browse the repository at this point in the history
  • Loading branch information
adya committed Apr 6, 2024
1 parent 830e42a commit 3dbc218
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SPID/include/LookupNPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace NPC
struct ID
{
ID() = default;
explicit ID(const RE::TESActorBase* a_base);
explicit ID(const RE::TESForm* a_base);
~ID() = default;

[[nodiscard]] bool contains(const std::string& a_str) const;
Expand Down
6 changes: 5 additions & 1 deletion SPID/src/LookupNPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace NPC
{
Data::ID::ID(const RE::TESActorBase* a_base) :
Data::ID::ID(const RE::TESForm* a_base) :
formID(a_base->GetFormID()),
editorID(editorID::get_editorID(a_base))
{}
Expand Down Expand Up @@ -42,6 +42,10 @@ namespace NPC
return RE::BSContainer::ForEachResult::kContinue;
});

if (npc->baseTemplateForm) {
IDs.emplace_back(npc->baseTemplateForm);
}

if (const auto extraLvlCreature = a_actor->extraList.GetByType<RE::ExtraLeveledCreature>()) {
if (const auto originalBase = extraLvlCreature->originalBase) {
IDs.emplace_back(originalBase);
Expand Down

0 comments on commit 3dbc218

Please sign in to comment.