Skip to content

Commit

Permalink
Background feats should now try to add themselves to the BG feat slot
Browse files Browse the repository at this point in the history
  • Loading branch information
bLittle1996 committed Aug 27, 2021
1 parent 6c53aba commit 1ab0b38
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/converter/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,21 @@ export const addBackgroundFeatures = async (
for (const feat of backgroundFeatsToAdd) {
const compendiumFeat = await getCompendiumDocument(feat.pack, feat.id);
if (!compendiumFeat) {
debugLog("addBackgroundFeatures() Unable to find compendium feat", {
feat,
});
debugLog("addBackgroundFeatures() Unable to find compendium feat", feat);
continue;
}
featDocuments = [...featDocuments, compendiumFeat.data];
let location = null;
if (feat.pack === "pf2e.feats-srd") {
location = background.id;
}

featDocuments = [
...featDocuments,
{
...compendiumFeat.data,
data: { ...compendiumFeat.data.data, location },
},
];
}

debugLog("addBackgroundFeatures() Adding background features", {
Expand Down

0 comments on commit 1ab0b38

Please sign in to comment.