XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

fix: give no rewards if there are no qualifications (#1826)

Fixes #1823 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1826 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

70646160
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +6 -7
Modified src/services/missionInventoryUpdateService.ts +6 -7
@@ -73,13 +73,11 @@ const getRotations = (rewardInfo: IRewardInfo, tierOverride?: number): number[]
73 73 return [rewardInfo.rewardTier];
74 74 }
75 75
76 // Aborting a railjack mission should not give any rewards (https://onlyg.it/OpenWF/SpaceNinjaServer/issues/1741)
77 if (rewardInfo.rewardQualifications === undefined) {
78 return [];
79 }
76 const rotationCount = rewardInfo.rewardQualifications?.length || 0;
80 77
81 const rotationCount = rewardInfo.rewardQualifications.length || 0;
82 if (rotationCount === 0) return [0];
78 // Empty or absent rewardQualifications should not give rewards:
79 // - Aborting a railjack mission (https://onlyg.it/OpenWF/SpaceNinjaServer/issues/1741)
80 // - Completing only 1 zone of (E)SO (https://onlyg.it/OpenWF/SpaceNinjaServer/issues/1823)
83 81
84 82 const rotationPattern =
85 83 tierOverride === undefined
@@ -792,7 +790,8 @@ export const addMissionRewards = async (
792 790 missions.Tag != "SolNode761" && // the index
793 791 missions.Tag != "SolNode762" && // the index
794 792 missions.Tag != "SolNode763" && // the index
795 missions.Tag != "CrewBattleNode556" // free flight
793 missions.Tag != "CrewBattleNode556" && // free flight
794 getRotations(rewardInfo).length > 0 // (E)SO should not give credits for only completing zone 1, in which case it has no rewardQualifications (https://onlyg.it/OpenWF/SpaceNinjaServer/issues/1823)
796 795 ) {
797 796 const levelCreditReward = getLevelCreditRewards(node);
798 797 missionCompletionCredits += levelCreditReward;