fix: ensure that only one CrewMember is ever on call (#2069)
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:
parent
2a40449604
commit
85a45a04ea
@ -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({
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user