fix: put acquired railjack components into the salvage array
All checks were successful
Build / build (push) Successful in 1m24s
Build / build (pull_request) Successful in 1m24s

This commit is contained in:
Sainan 2025-04-15 20:23:46 +02:00
parent 3165d9f459
commit 952370f4a0

View File

@ -408,8 +408,19 @@ export const addItem = async (
const meta = ExportCustoms[typeName];
let inventoryChanges: IInventoryChanges;
if (meta.productCategory == "CrewShipWeaponSkins") {
inventoryChanges = addCrewShipWeaponSkin(inventory, typeName);
// Add to raw salvage. It needs to be identified to get stats and then be moved into the CrewShipWeaponSkins proper.
const rawSalvageChanges = [
{
ItemType: typeName,
ItemCount: quantity
}
];
addCrewShipRawSalvage(inventory, rawSalvageChanges);
inventoryChanges = { CrewShipRawSalvage: rawSalvageChanges };
} else {
if (quantity != 1) {
throw new Error(`unexpected acquisition quantity of WeaponSkins: got ${quantity}, expected 1`);
}
inventoryChanges = addSkin(inventory, typeName);
}
if (meta.additionalItems) {
@ -1083,6 +1094,7 @@ export const addSkin = (
return inventoryChanges;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const addCrewShipWeaponSkin = (
inventory: TInventoryDatabaseDocument,
typeName: string,