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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

fix: ensure that only one CrewMember is ever on call (#2069)

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

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

代码差异

2 个文件 +9 -1
Modified src/controllers/api/crewMembersController.ts +8 -0
@@ -15,6 +15,14 @@ export const crewMembersController: RequestHandler = async (req, res) => {
15 15 dbCrewMember.WeaponConfigIdx = data.crewMember.WeaponConfigIdx;
16 16 dbCrewMember.WeaponId = new Types.ObjectId(data.crewMember.WeaponId.$oid);
17 17 dbCrewMember.Configs = data.crewMember.Configs;
18 if (data.crewMember.SecondInCommand) {
19 for (const cm of inventory.CrewMembers) {
20 if (cm.SecondInCommand) {
21 cm.SecondInCommand = false;
22 break;
23 }
24 }
25 }
18 26 dbCrewMember.SecondInCommand = data.crewMember.SecondInCommand;
19 27 await inventory.save();
20 28 res.json({
Modified src/services/missionInventoryUpdateService.ts +1 -1
@@ -631,7 +631,7 @@ export const addMissionInventoryUpdates = async (
631 631 Rank: inventory.Nemesis.Rank,
632 632 Traded: inventory.Nemesis.Traded,
633 633 PrevOwners: inventory.Nemesis.PrevOwners,
634 SecondInCommand: inventory.Nemesis.SecondInCommand,
634 SecondInCommand: false,
635 635 Weakened: inventory.Nemesis.Weakened,
636 636 // And set killed flag
637 637 k: value.killed