From 23abe5de023871756a0b058255b45efd3fbf2612 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sat, 25 Oct 2025 00:27:02 -0700 Subject: [PATCH] fix: junction completion on steel path doesn't save (#2937) Aka., an alternative approach to fixing the problem in #2866. Junctions don't have RewardInfo and therefore weren't reaching the new call to addMissionComplete. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2937 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/services/inventoryService.ts | 2 +- src/services/missionInventoryUpdateService.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index d5dd1549..66668b68 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -2180,7 +2180,7 @@ export const addMissionComplete = (inventory: TInventoryDatabaseDocument, { Tag, if (itemIndex !== -1) { Missions[itemIndex].Completes += Completes; - if (Tier) { + if (Completes && Tier) { Missions[itemIndex].Tier = Tier; } } else { diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 336efe87..c8e0f50c 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -310,6 +310,9 @@ export const addMissionInventoryUpdates = async ( } break; } + case "Missions": + addMissionComplete(inventory, value); + break; case "LastRegionPlayed": if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) { inventory.LastRegionPlayed = value; @@ -1242,9 +1245,6 @@ export const addMissionRewards = async ( if (missions && missions.Tag in ExportRegions) { const node = ExportRegions[missions.Tag]; - // cannot add this with normal updates because { Tier: 1 } would mark the SP node as completed even on a failure - addMissionComplete(inventory, missions); - //node based credit rewards for mission completion if (isEligibleForCreditReward(rewardInfo, missions, node)) { const levelCreditReward = getLevelCreditRewards(node);