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: use JobTier instead of parsing the jobId for it (#1649)

Should fix #1647 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1649 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

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

代码差异

1 个文件 +5 -8
Modified src/services/missionInventoryUpdateService.ts +5 -8
@@ -738,14 +738,12 @@ export const addMissionRewards = async (
738 738
739 739 if (rewardInfo.JobStage != undefined && rewardInfo.jobId) {
740 740 // eslint-disable-next-line @typescript-eslint/no-unused-vars
741 const [jobType, tierStr, hubNode, syndicateId, locationTag] = rewardInfo.jobId.split("_");
742 const tier = Number(tierStr);
743
741 const [jobType, unkIndex, hubNode, syndicateId, locationTag] = rewardInfo.jobId.split("_");
744 742 const worldState = getWorldState();
745 743 let syndicateEntry = worldState.SyndicateMissions.find(m => m._id.$oid === syndicateId);
746 744 if (!syndicateEntry) syndicateEntry = worldState.SyndicateMissions.find(m => m.Tag === syndicateId); // Sometimes syndicateId can be tag
747 745 if (syndicateEntry && syndicateEntry.Jobs) {
748 let currentJob = syndicateEntry.Jobs[tier];
746 let currentJob = syndicateEntry.Jobs[rewardInfo.JobTier!];
749 747 if (syndicateEntry.Tag === "EntratiSyndicate") {
750 748 const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);
751 749 if (vault) currentJob = vault;
@@ -770,7 +768,7 @@ export const addMissionRewards = async (
770 768 });
771 769 SyndicateXPItemReward = medallionAmount;
772 770 } else {
773 if (tier >= 0) {
771 if (rewardInfo.JobTier! >= 0) {
774 772 AffiliationMods.push(
775 773 addStanding(inventory, syndicateEntry.Tag, currentJob.xpAmounts[rewardInfo.JobStage])
776 774 );
@@ -946,8 +944,7 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
946 944 if (RewardInfo.jobId) {
947 945 if (RewardInfo.JobStage! >= 0) {
948 946 // eslint-disable-next-line @typescript-eslint/no-unused-vars
949 const [jobType, tierStr, hubNode, syndicateId, locationTag] = RewardInfo.jobId.split("_");
950 const tier = Number(tierStr);
947 const [jobType, unkIndex, hubNode, syndicateId, locationTag] = RewardInfo.jobId.split("_");
951 948 let isEndlessJob = false;
952 949 if (syndicateId) {
953 950 const worldState = getWorldState();
@@ -955,7 +952,7 @@ function getRandomMissionDrops(RewardInfo: IRewardInfo, tierOverride: number | u
955 952 if (!syndicateEntry) syndicateEntry = worldState.SyndicateMissions.find(m => m.Tag === syndicateId);
956 953
957 954 if (syndicateEntry && syndicateEntry.Jobs) {
958 let job = syndicateEntry.Jobs[tier];
955 let job = syndicateEntry.Jobs[RewardInfo.JobTier!];
959 956
960 957 if (syndicateEntry.Tag === "EntratiSyndicate") {
961 958 const vault = syndicateEntry.Jobs.find(j => j.locationTag === locationTag);