fix: refuse to add items non-fatally
All checks were successful
Build / build (22) (push) Successful in 37s
Build / build (20) (push) Successful in 1m14s
Build / build (18) (pull_request) Successful in 40s
Build / build (18) (push) Successful in 1m29s
Build / build (20) (pull_request) Successful in 1m14s
Build / build (22) (pull_request) Successful in 37s
All checks were successful
Build / build (22) (push) Successful in 37s
Build / build (20) (push) Successful in 1m14s
Build / build (18) (pull_request) Successful in 40s
Build / build (18) (push) Successful in 1m29s
Build / build (20) (pull_request) Successful in 1m14s
Build / build (22) (pull_request) Successful in 37s
This is needed to complete to the railjack quest when already owning a railjack
This commit is contained in:
parent
65306e0478
commit
e1b97f972d
@ -1071,11 +1071,12 @@ const addCrewShip = (
|
|||||||
inventoryChanges: IInventoryChanges = {}
|
inventoryChanges: IInventoryChanges = {}
|
||||||
): IInventoryChanges => {
|
): IInventoryChanges => {
|
||||||
if (inventory.CrewShips.length != 0) {
|
if (inventory.CrewShips.length != 0) {
|
||||||
throw new Error("refusing to add CrewShip because account already has one");
|
logger.error("refusing to add CrewShip because account already has one");
|
||||||
}
|
} else {
|
||||||
const index = inventory.CrewShips.push({ ItemType: typeName }) - 1;
|
const index = inventory.CrewShips.push({ ItemType: typeName }) - 1;
|
||||||
inventoryChanges.CrewShips ??= [];
|
inventoryChanges.CrewShips ??= [];
|
||||||
inventoryChanges.CrewShips.push(inventory.CrewShips[index].toJSON<IEquipmentClient>());
|
inventoryChanges.CrewShips.push(inventory.CrewShips[index].toJSON<IEquipmentClient>());
|
||||||
|
}
|
||||||
return inventoryChanges;
|
return inventoryChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1085,11 +1086,12 @@ const addCrewShipHarness = (
|
|||||||
inventoryChanges: IInventoryChanges = {}
|
inventoryChanges: IInventoryChanges = {}
|
||||||
): IInventoryChanges => {
|
): IInventoryChanges => {
|
||||||
if (inventory.CrewShipHarnesses.length != 0) {
|
if (inventory.CrewShipHarnesses.length != 0) {
|
||||||
throw new Error("refusing to add CrewShipHarness because account already has one");
|
logger.error("refusing to add CrewShipHarness because account already has one");
|
||||||
}
|
} else {
|
||||||
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
|
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
|
||||||
inventoryChanges.CrewShipHarnesses ??= [];
|
inventoryChanges.CrewShipHarnesses ??= [];
|
||||||
inventoryChanges.CrewShipHarnesses.push(inventory.CrewShipHarnesses[index].toJSON<IEquipmentClient>());
|
inventoryChanges.CrewShipHarnesses.push(inventory.CrewShipHarnesses[index].toJSON<IEquipmentClient>());
|
||||||
|
}
|
||||||
return inventoryChanges;
|
return inventoryChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1099,11 +1101,12 @@ const addMotorcycle = (
|
|||||||
inventoryChanges: IInventoryChanges = {}
|
inventoryChanges: IInventoryChanges = {}
|
||||||
): IInventoryChanges => {
|
): IInventoryChanges => {
|
||||||
if (inventory.Motorcycles.length != 0) {
|
if (inventory.Motorcycles.length != 0) {
|
||||||
throw new Error("refusing to add Motorcycle because account already has one");
|
logger.error("refusing to add Motorcycle because account already has one");
|
||||||
}
|
} else {
|
||||||
const index = inventory.Motorcycles.push({ ItemType: typeName }) - 1;
|
const index = inventory.Motorcycles.push({ ItemType: typeName }) - 1;
|
||||||
inventoryChanges.Motorcycles ??= [];
|
inventoryChanges.Motorcycles ??= [];
|
||||||
inventoryChanges.Motorcycles.push(inventory.Motorcycles[index].toJSON<IEquipmentClient>());
|
inventoryChanges.Motorcycles.push(inventory.Motorcycles[index].toJSON<IEquipmentClient>());
|
||||||
|
}
|
||||||
return inventoryChanges;
|
return inventoryChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user