feat: acquiring CrewShipHarness with CrewShip
This commit is contained in:
parent
01d369bf38
commit
5b584efbf2
@ -239,7 +239,13 @@ export const addItem = async (
|
||||
}
|
||||
};
|
||||
} else if (ExportResources[typeName].productCategory == "CrewShips") {
|
||||
const inventoryChanges = addCrewShip(inventory, typeName);
|
||||
const inventoryChanges = {
|
||||
...addCrewShip(inventory, typeName),
|
||||
...(!inventory.CrewShipHarnesses?.length
|
||||
? addCrewShipHarness(inventory, "/Lotus/Types/Game/CrewShip/RailJack/DefaultHarness")
|
||||
: {})
|
||||
};
|
||||
|
||||
return { InventoryChanges: inventoryChanges };
|
||||
} else if (ExportResources[typeName].productCategory == "ShipDecorations") {
|
||||
const changes = [
|
||||
@ -804,6 +810,17 @@ const addCrewShip = (
|
||||
return inventoryChanges;
|
||||
};
|
||||
|
||||
const addCrewShipHarness = (
|
||||
inventory: TInventoryDatabaseDocument,
|
||||
typeName: string,
|
||||
inventoryChanges: IInventoryChanges = {}
|
||||
): IInventoryChanges => {
|
||||
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
|
||||
inventoryChanges.CrewShipHarnesses ??= [];
|
||||
(inventoryChanges.CrewShipHarnesses as object[]).push(inventory.CrewShipHarnesses[index].toJSON());
|
||||
return inventoryChanges;
|
||||
};
|
||||
|
||||
//TODO: wrong id is not erroring
|
||||
export const addGearExpByCategory = (
|
||||
inventory: TInventoryDatabaseDocument,
|
||||
|
Loading…
x
Reference in New Issue
Block a user