fix: logic error in addCrewShipHarness

This commit is contained in:
Sainan 2025-02-28 03:51:08 +01:00
parent 526ce1529b
commit d63bab1bf4

View File

@ -855,7 +855,7 @@ const addCrewShipHarness = (
typeName: string, typeName: string,
inventoryChanges: IInventoryChanges = {} inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => { ): IInventoryChanges => {
if (inventory.CrewShips.length != 0) { if (inventory.CrewShipHarnesses.length != 0) {
throw new Error("refusing to add CrewShipHarness because account already has one"); throw new Error("refusing to add CrewShipHarness because account already has one");
} }
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1; const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;