fix(industry): check toolRequired in findCraftable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
root
2026-03-08 23:33:58 +00:00
parent 412e4dab7a
commit 878c6fe2b2
+1
View File
@@ -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);
});
}