Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perk filters #53

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion SPID/include/Cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ namespace FormType
RE::FormType::FormList,
RE::FormType::Spell,
RE::FormType::Armor,
RE::FormType::Location
RE::FormType::Location,
RE::FormType::Perk
};

bool GetWhitelisted(RE::FormType a_type);
Expand Down
12 changes: 6 additions & 6 deletions SPID/src/Distribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ namespace Distribute
},
accumulatedForms);

for_each_form<RE::BGSPerk>(
npcData, forms.perks, input, [&](const std::vector<RE::BGSPerk*>& a_perks) {
npc->AddPerks(a_perks, 1);
},
accumulatedForms);

for_each_form<RE::SpellItem>(
npcData, forms.spells, input, [&](const std::vector<RE::SpellItem*>& a_spells) {
npc->GetSpellList()->AddSpells(a_spells);
Expand All @@ -36,12 +42,6 @@ namespace Distribute
},
accumulatedForms);

for_each_form<RE::BGSPerk>(
npcData, forms.perks, input, [&](const std::vector<RE::BGSPerk*>& a_perks) {
npc->AddPerks(a_perks, 1);
},
accumulatedForms);

for_each_form<RE::TESShout>(
npcData, forms.shouts, input, [&](const std::vector<RE::TESShout*>& a_shouts) {
npc->GetSpellList()->AddShouts(a_shouts);
Expand Down
5 changes: 5 additions & 0 deletions SPID/src/LookupNPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ namespace NPC
const auto location = a_form->As<RE::BGSLocation>();
return actor->GetEditorLocation() == location;
}
case RE::FormType::Perk:
{
const auto perk = a_form->As<RE::BGSPerk>();
return actor->HasPerk(perk);
}
case RE::FormType::FormList:
{
bool result = false;
Expand Down
Loading