fix: refuse to add items non-fatally #1476

Merged
Sainan merged 2 commits from non-fatal-refusal into main 2025-04-06 06:04:31 -07:00
Showing only changes of commit 9f38b1cc87 - Show all commits

View File

@ -1071,7 +1071,7 @@ const addCrewShip = (
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
if (inventory.CrewShips.length != 0) {
logger.error("refusing to add CrewShip because account already has one");
logger.warn("refusing to add CrewShip because account already has one");
} else {
const index = inventory.CrewShips.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShips ??= [];
@ -1086,7 +1086,7 @@ const addCrewShipHarness = (
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
if (inventory.CrewShipHarnesses.length != 0) {
logger.error("refusing to add CrewShipHarness because account already has one");
logger.warn("refusing to add CrewShipHarness because account already has one");
} else {
const index = inventory.CrewShipHarnesses.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShipHarnesses ??= [];
@ -1101,7 +1101,7 @@ const addMotorcycle = (
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
if (inventory.Motorcycles.length != 0) {
logger.error("refusing to add Motorcycle because account already has one");
logger.warn("refusing to add Motorcycle because account already has one");
} else {
const index = inventory.Motorcycles.push({ ItemType: typeName }) - 1;
inventoryChanges.Motorcycles ??= [];