Skip to content

Commit 48ca356

Browse files
committed
assign wiki link in one spot
1 parent 5e142bb commit 48ca356

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/tarkov-data-manager/jobs/update-quests.mjs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class UpdateQuestsJob extends DataJob {
133133
try {
134134
this.logger.warn(`Adding missing quest ${quest.name} ${quest.id}...`);
135135
quest.name = this.addTranslation(`${questId} name`);
136-
quest.wikiLink = `https://escapefromtarkov.fandom.com/wiki/${encodeURIComponent(this.locales.en[`${questId} name`].replaceAll(' ', '_'))}`;
137136
for (const obj of quest.objectives) {
138137
obj.description = this.addTranslation(obj.id);
139138
if (obj.type.endsWith('QuestItem')) {
@@ -285,11 +284,13 @@ class UpdateQuestsJob extends DataJob {
285284

286285
quest.minPlayerLevel = getQuestMinLevel(quest.id);
287286

288-
const trader = this.traders.find(t => t.name === quest.name);
287+
const trader = this.traders.find(t => t.normalizedName === quest.normalizedName);
289288
const map = this.maps.find(m => m.normalizedName === quest.normalizedName);
289+
let wikiLinkSuffix = '';
290290
if (trader || map) {
291-
quest.wikiLink = `https://escapefromtarkov.fandom.com/wiki/${encodeURIComponent(this.getTranslation(quest.name).replaceAll(' ', '_'))}_(quest)`;
291+
wikiLinkSuffix = '_(quest)';
292292
}
293+
quest.wikiLink = `https://escapefromtarkov.fandom.com/wiki/${encodeURIComponent(this.getTranslation(quest.name).replaceAll(' ', '_'))}${wikiLinkSuffix}`;
293294

294295
quest.kappaRequired = false;
295296
quest.lightkeeperRequired = false;
@@ -957,7 +958,7 @@ class UpdateQuestsJob extends DataJob {
957958
traderName: this.locales.en[`${quest.traderId} Nickname`],
958959
location_id: locationId,
959960
locationName: locationName,
960-
wikiLink: `https://escapefromtarkov.fandom.com/wiki/${encodeURIComponent(this.locales.en[`${questId} name`].replaceAll(' ', '_'))}`,
961+
wikiLink: ``,
961962
minPlayerLevel: 0,
962963
taskRequirements: [],
963964
traderLevelRequirements: [],

0 commit comments

Comments
 (0)