fix: handle CurrentLoadOutIds missing LoadOuts in missionInventoryUpdate #1421

Merged
Sainan merged 1 commits from no-loadouts into main 2025-04-01 15:48:41 -07:00
2 changed files with 13 additions and 11 deletions

View File

@ -414,6 +414,7 @@ export const addMissionInventoryUpdates = async (
break;
}
case "CurrentLoadOutIds": {
if (value.LoadOuts) {
const loadout = await Loadout.findOne({ loadoutOwnerId: inventory.accountOwnerId });
if (loadout) {
for (const [loadoutId, loadoutConfig] of Object.entries(value.LoadOuts.NORMAL)) {
@ -426,6 +427,7 @@ export const addMissionInventoryUpdates = async (
}
await loadout.save();
}
}
break;
}
default:

View File

@ -114,7 +114,7 @@ export type IMissionInventoryUpdateRequest = {
UnlockWeapons?: boolean; // sent when recovered weapons from zanuka capture
IncHarvester?: boolean; // sent when recovered weapons from zanuka capture
CurrentLoadOutIds?: {
LoadOuts: ILoadOutPresets; // sent when recovered weapons from zanuka capture
LoadOuts?: ILoadOutPresets; // sent when recovered weapons from zanuka capture
};
} & {
[K in TEquipmentKey]?: IEquipmentClient[];