chore: fix slotNames duplication #1798
@ -37,6 +37,7 @@ import {
|
|||||||
} from "../types/inventoryTypes/inventoryTypes";
|
} from "../types/inventoryTypes/inventoryTypes";
|
||||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
|
||||||
import { ILoadoutConfigDatabase, ILoadoutDatabase } from "../types/saveLoadoutTypes";
|
import { ILoadoutConfigDatabase, ILoadoutDatabase } from "../types/saveLoadoutTypes";
|
||||||
|
import { slotNames } from "../types/purchaseTypes";
|
||||||
|
|
||||||
const convertDate = (value: IMongoDate): Date => {
|
const convertDate = (value: IMongoDate): Date => {
|
||||||
return new Date(parseInt(value.$date.$numberLong));
|
return new Date(parseInt(value.$date.$numberLong));
|
||||||
@ -212,20 +213,7 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
|
|||||||
replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig));
|
replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const key of [
|
for (const key of slotNames) {
|
||||||
"SuitBin",
|
|
||||||
"WeaponBin",
|
|
||||||
"SentinelBin",
|
|
||||||
"SpaceSuitBin",
|
|
||||||
"SpaceWeaponBin",
|
|
||||||
"PvpBonusLoadoutBin",
|
|
||||||
"PveBonusLoadoutBin",
|
|
||||||
"RandomModBin",
|
|
||||||
"MechBin",
|
|
||||||
"CrewMemberBin",
|
|
||||||
"OperatorAmpBin",
|
|
||||||
"CrewShipSalvageBin"
|
|
||||||
] as const) {
|
|
||||||
if (client[key] !== undefined) {
|
if (client[key] !== undefined) {
|
||||||
replaceSlots(db[key], client[key]);
|
replaceSlots(db[key], client[key]);
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ export const slotNames = [
|
|||||||
"WeaponBin",
|
"WeaponBin",
|
||||||
"MechBin",
|
"MechBin",
|
||||||
"PveBonusLoadoutBin",
|
"PveBonusLoadoutBin",
|
||||||
|
"PvpBonusLoadoutBin",
|
||||||
"SentinelBin",
|
"SentinelBin",
|
||||||
"SpaceSuitBin",
|
"SpaceSuitBin",
|
||||||
"SpaceWeaponBin",
|
"SpaceWeaponBin",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user