Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 committed Jan 16, 2024
2 parents 1377568 + 95794b7 commit 28fbcdb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions SPID/include/Distribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace Distribute
for (auto& formData : vec) { // Vector is reversed in FinishLookupForms
if (detail::passed_filters(a_npcData, a_input, formData) && a_callback(formData.form)) {
++formData.npcCount;
break;
break;
}
}
}
Expand All @@ -123,7 +123,7 @@ namespace Distribute
for (auto& formData : vec) { // Vector is reversed in FinishLookupForms
if (detail::passed_filters(a_npcData, formData) && a_callback(formData.form)) {
++formData.npcCount;
break;
break;
}
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ namespace Distribute
hasLeveledItems = true;
}
collectedForms.emplace(formData.form, formData.idxOrCount);
++formData.npcCount;
++formData.npcCount;
}
}

Expand Down Expand Up @@ -198,7 +198,7 @@ namespace Distribute
if (formData.filters.HasLevelFilters()) {
collectedLeveledFormIDs.emplace(formID);
}
++formData.npcCount;
++formData.npcCount;
}
} else {
if (detail::passed_filters(a_npcData, a_input, formData) && !detail::has_form(npc, form) && collectedFormIDs.emplace(formID).second) {
Expand Down Expand Up @@ -254,7 +254,7 @@ namespace Distribute
} else {
if (detail::passed_filters(a_npcData, formData) && !detail::has_form(npc, form) && collectedFormIDs.emplace(formID).second) {
collectedForms.emplace_back(form);
++formData.npcCount;
++formData.npcCount;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions SPID/src/Distribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace Distribute
});
}

void DistributeItemOutfits(NPCData& a_npcData, const PCLevelMult::Input& a_input)
void DistributeItemOutfits(NPCData& a_npcData, const PCLevelMult::Input& a_input)
{
if (a_input.onlyPlayerLevelEntries && PCLevelMult::Manager::GetSingleton()->HasHitLevelCap(a_input)) {
return;
Expand All @@ -182,7 +182,7 @@ namespace Distribute
return false;
});

for_each_form<RE::BGSOutfit>(a_npcData, Forms::outfits, a_input, [&](auto* a_outfit) {
for_each_form<RE::BGSOutfit>(a_npcData, Forms::outfits, a_input, [&](auto* a_outfit) {
if (detail::can_equip_outfit(npc, a_outfit)) {
actor->RemoveOutfitItems(npc->defaultOutfit);
npc->defaultOutfit = a_outfit;
Expand All @@ -193,11 +193,11 @@ namespace Distribute
});
}

void Distribute(NPCData& a_npcData, bool a_onlyLeveledEntries, bool a_noItemOutfits)
void Distribute(NPCData& a_npcData, bool a_onlyLeveledEntries, bool a_noItemOutfits)
{
const auto input = PCLevelMult::Input{ a_npcData.GetActor(), a_npcData.GetNPC(), a_onlyLeveledEntries };
const auto input = PCLevelMult::Input{ a_npcData.GetActor(), a_npcData.GetNPC(), a_onlyLeveledEntries };

Distribute(a_npcData, input);
Distribute(a_npcData, input);
if (!a_noItemOutfits) {
DistributeItemOutfits(a_npcData, input);
}
Expand Down
8 changes: 4 additions & 4 deletions SPID/src/DistributeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace Distribute
static bool thunk(RE::Character* a_this)
{
if (auto npc = a_this->GetActorBase()) {
const auto process = detail::should_process_NPC(npc);
const auto processOnLoad = detail::should_process_NPC(npc, processedOnLoad);
const auto process = detail::should_process_NPC(npc);
const auto processOnLoad = detail::should_process_NPC(npc, processedOnLoad);
if (process || processOnLoad) {
auto npcData = NPCData(a_this, npc);
if (process) {
Expand Down Expand Up @@ -144,9 +144,9 @@ namespace Distribute
Timer timer;
std::uint32_t actorCount = 0;

if (const auto processLists = RE::ProcessLists::GetSingleton()) {
if (const auto processLists = RE::ProcessLists::GetSingleton()) {
timer.start();
processLists->ForAllActors([&](RE::Actor* a_actor) {
processLists->ForAllActors([&](RE::Actor* a_actor) {
if (const auto npc = a_actor->GetActorBase(); npc && detail::should_process_NPC(npc)) {
auto npcData = NPCData(a_actor, npc);
Distribute(npcData, false, true);
Expand Down
2 changes: 1 addition & 1 deletion SPID/src/LookupNPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace NPC
},
[&](const RE::TESFile* a_file) {
result = std::ranges::any_of(IDs, [&](const auto& ID) { return ID == a_file; });
}},
} },
a_formFile);
return result;
};
Expand Down

0 comments on commit 28fbcdb

Please sign in to comment.