fix: ensure that only one CrewMember is ever on call (#2069)
All checks were successful
Build Docker image / docker (push) Successful in 1m16s
Build / build (push) Successful in 57s

Reviewed-on: #2069
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
Sainan 2025-05-13 08:25:09 -07:00 committed by Sainan
parent 2a40449604
commit 85a45a04ea
2 changed files with 9 additions and 1 deletions

View File

@ -15,6 +15,14 @@ export const crewMembersController: RequestHandler = async (req, res) => {
dbCrewMember.WeaponConfigIdx = data.crewMember.WeaponConfigIdx;
dbCrewMember.WeaponId = new Types.ObjectId(data.crewMember.WeaponId.$oid);
dbCrewMember.Configs = data.crewMember.Configs;
if (data.crewMember.SecondInCommand) {
for (const cm of inventory.CrewMembers) {
if (cm.SecondInCommand) {
cm.SecondInCommand = false;
break;
}
}
}
dbCrewMember.SecondInCommand = data.crewMember.SecondInCommand;
await inventory.save();
res.json({

View File

@ -631,7 +631,7 @@ export const addMissionInventoryUpdates = async (
Rank: inventory.Nemesis.Rank,
Traded: inventory.Nemesis.Traded,
PrevOwners: inventory.Nemesis.PrevOwners,
SecondInCommand: inventory.Nemesis.SecondInCommand,
SecondInCommand: false,
Weakened: inventory.Nemesis.Weakened,
// And set killed flag
k: value.killed