fix(industry): check toolRequired in findCraftable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,7 @@ export class RecipeRegistry {
|
||||
findCraftable(inv: Inventory, workshopType?: string): Recipe[] {
|
||||
return this.getAll().filter(recipe => {
|
||||
if (recipe.workshopType && recipe.workshopType !== workshopType) return false;
|
||||
if (recipe.toolRequired && !inv.has(recipe.toolRequired)) return false;
|
||||
return recipe.inputs.every(input => (inv.get(input.itemId) ?? 0) >= input.quantity);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user