Skip to content

Commit d24cd30

Browse files
authored
Fix links to duplicated content in pf2e-anachronism (#22149)
1 parent e65e4e5 commit d24cd30

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

build/anachronism.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,13 @@ for (const contentSystem of contentSystems) {
181181
const pair = packPairsById[normalizedPackId];
182182
if (!pair) return null;
183183

184-
const entryInTargetSystem = pair.get(targetSystem, docNameOrId);
184+
// Pull the entry in the target and content systems, prioritizing target system variants
185+
// Note that in the case of duplicates, sf2e does not contain the item, so we may need to fetch from pf2e
186+
// This is only important for the target system, since we want to redirect content to target if it exists
185187
const entryInContentSystem = pair.get(contentSystem, docNameOrId);
188+
const entryInTargetSystem =
189+
pair.get(targetSystem, docNameOrId) ??
190+
(entryInContentSystem && pair.duplicated.has(entryInContentSystem.name) ? entryInContentSystem : null);
186191
const id = entryInTargetSystem?._id ?? entryInContentSystem?._id;
187192
const name = entryInTargetSystem?.name ?? entryInContentSystem?.name;
188193
if (!name || !id) return null;

module.pf2e-anachronism.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"id": "pf2e-anachronism",
33
"title": "Pathfinder Anachronism: Official Pathfinder Content Pack for Starfinder Second Edition",
44
"description": "<p>Official Pathfinder 2e content pack for Starfinder 2e! Add PF2e character options, creatures, and items into your SF2e game!</p>",
5-
"version": "2.0.1",
5+
"version": "2.0.2",
66
"license": "./LICENSE",
77
"manifest": "https://raw.githubusercontent.com/foundryvtt/pf2e/v14-dev/module.pf2e-anachronism.json",
8-
"download": "https://github.com/foundryvtt/pf2e/releases/download/pf2e-anachronism-2.0.1/module.zip",
8+
"download": "https://github.com/foundryvtt/pf2e/releases/download/pf2e-anachronism-2.0.2/module.zip",
99
"url": "https://github.com/foundryvtt/pf2e",
1010
"bugs": "https://github.com/foundryvtt/pf2e/issues",
1111
"socket": true,

0 commit comments

Comments
 (0)