handle in CurrentLoadOutIds in missionInventoryUpdate just for correctness' sake (at least for NORMAL config)
All checks were successful
Build / build (22) (push) Successful in 37s
Build / build (20) (pull_request) Successful in 39s
Build / build (18) (pull_request) Successful in 1m12s
Build / build (18) (push) Successful in 42s
Build / build (20) (push) Successful in 1m7s
Build / build (22) (pull_request) Successful in 41s

This commit is contained in:
Sainan 2025-04-01 02:19:34 +02:00
parent d0df003eee
commit 381ab49cad
2 changed files with 21 additions and 1 deletions

View File

@ -47,6 +47,7 @@ import kuriaMessage100 from "@/static/fixed_responses/kuriaMessages/oneHundredPe
import conservationAnimals from "@/static/fixed_responses/conservationAnimals.json";
import { getInfNodes } from "@/src/helpers/nemesisHelpers";
import { Loadout } from "../models/inventoryModels/loadoutModel";
import { ILoadoutConfigDatabase } from "../types/saveLoadoutTypes";
const getRotations = (rotationCount: number): number[] => {
if (rotationCount === 0) return [0];
@ -412,6 +413,21 @@ export const addMissionInventoryUpdates = async (
inventory.LockedWeaponGroup = undefined;
break;
}
case "CurrentLoadOutIds": {
const loadout = await Loadout.findOne({ loadoutOwnerId: inventory.accountOwnerId });
if (loadout) {
for (const [loadoutId, loadoutConfig] of Object.entries(value.LoadOuts.NORMAL)) {
const { ItemId, ...loadoutConfigItemIdRemoved } = loadoutConfig;
const loadoutConfigDatabase: ILoadoutConfigDatabase = {
_id: new Types.ObjectId(ItemId.$oid),
...loadoutConfigItemIdRemoved
};
loadout.NORMAL.id(loadoutId)!.overwrite(loadoutConfigDatabase);
}
await loadout.save();
}
break;
}
default:
// Equipment XP updates
if (equipmentKeys.includes(key as TEquipmentKey)) {

View File

@ -18,7 +18,8 @@ import {
IUpgradeClient,
ICollectibleEntry,
IDiscoveredMarker,
ILockedWeaponGroupClient
ILockedWeaponGroupClient,
ILoadOutPresets
} from "./inventoryTypes/inventoryTypes";
export interface IAffiliationChange {
@ -112,6 +113,9 @@ export type IMissionInventoryUpdateRequest = {
LockedWeaponGroup?: ILockedWeaponGroupClient; // sent when captured by zanuka
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
};
} & {
[K in TEquipmentKey]?: IEquipmentClient[];
};