Skip to content

Commit

Permalink
Used SetOutfit functions to distribute outfits.
Browse files Browse the repository at this point in the history
This does the same as Papyrus SetOutfit function. So should be safer?
  • Loading branch information
adya committed Jul 5, 2024
1 parent 5906948 commit 36dbe9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
15 changes: 3 additions & 12 deletions SPID/src/Distribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,13 @@ namespace Distribute

for_each_form<RE::BGSOutfit>(
npcData, forms.outfits, input, [&](auto* a_outfit) {
if (npc->defaultOutfit != a_outfit && (allowOverwrites || !npc->HasKeyword(processedOutfit))) {
npc->AddKeyword(processedOutfit);
npc->defaultOutfit = a_outfit;
return true;
}
return false;
return npcData.GetActor()->SetDefaultOutfit(a_outfit, false); // Having true here causes infinite loading. It seems that it works either way.
},
accumulatedForms);

for_each_form<RE::BGSOutfit>(
npcData, forms.sleepOutfits, input, [&](auto* a_outfit) {
if (npc->sleepOutfit != a_outfit) {
npc->sleepOutfit = a_outfit;
return true;
}
return false;
return npcData.GetActor()->SetSleepOutfit(a_outfit, false);
},
accumulatedForms);

Expand Down
1 change: 1 addition & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "spid-common",
"version-string": "1",
"builtin-baseline": "c4467cb686f92671f0172aa8299a77d908175b4e",
"dependencies": [
"clib-util",
"mergemapper",
Expand Down

0 comments on commit 36dbe9e

Please sign in to comment.