fix: unable to buy fish bait (#598)
This commit is contained in:
		
							parent
							
								
									c6ed013e23
								
							
						
					
					
						commit
						c2a9fc6609
					
				@ -35,6 +35,7 @@ import {
 | 
				
			|||||||
    ExportBoosterPacks,
 | 
					    ExportBoosterPacks,
 | 
				
			||||||
    ExportCustoms,
 | 
					    ExportCustoms,
 | 
				
			||||||
    ExportFlavour,
 | 
					    ExportFlavour,
 | 
				
			||||||
 | 
					    ExportGear,
 | 
				
			||||||
    ExportRecipes,
 | 
					    ExportRecipes,
 | 
				
			||||||
    ExportResources,
 | 
					    ExportResources,
 | 
				
			||||||
    ExportUpgrades
 | 
					    ExportUpgrades
 | 
				
			||||||
@ -186,6 +187,22 @@ export const addItem = async (
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (typeName in ExportGear) {
 | 
				
			||||||
 | 
					        const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
					        const consumablesChanges = [
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                ItemType: typeName,
 | 
				
			||||||
 | 
					                ItemCount: quantity
 | 
				
			||||||
 | 
					            } satisfies IConsumable
 | 
				
			||||||
 | 
					        ];
 | 
				
			||||||
 | 
					        addConsumables(inventory, consumablesChanges);
 | 
				
			||||||
 | 
					        await inventory.save();
 | 
				
			||||||
 | 
					        return {
 | 
				
			||||||
 | 
					            InventoryChanges: {
 | 
				
			||||||
 | 
					                Consumables: consumablesChanges
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Path-based duck typing
 | 
					    // Path-based duck typing
 | 
				
			||||||
    switch (typeName.substr(1).split("/")[1]) {
 | 
					    switch (typeName.substr(1).split("/")[1]) {
 | 
				
			||||||
@ -329,21 +346,6 @@ export const addItem = async (
 | 
				
			|||||||
                        };
 | 
					                        };
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case "Restoratives": // Codex Scanner, Remote Observer, Starburst
 | 
					 | 
				
			||||||
                    const inventory = await getInventory(accountId);
 | 
					 | 
				
			||||||
                    const consumablesChanges = [
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            ItemType: typeName,
 | 
					 | 
				
			||||||
                            ItemCount: quantity
 | 
					 | 
				
			||||||
                        } satisfies IConsumable
 | 
					 | 
				
			||||||
                    ];
 | 
					 | 
				
			||||||
                    addConsumables(inventory, consumablesChanges);
 | 
					 | 
				
			||||||
                    await inventory.save();
 | 
					 | 
				
			||||||
                    return {
 | 
					 | 
				
			||||||
                        InventoryChanges: {
 | 
					 | 
				
			||||||
                            Consumables: consumablesChanges
 | 
					 | 
				
			||||||
                        }
 | 
					 | 
				
			||||||
                    };
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user