diff --git a/Game/Dungeon/CraftingHandler.cs b/Game/Dungeon/CraftingHandler.cs index a95d78e..406d2bd 100644 --- a/Game/Dungeon/CraftingHandler.cs +++ b/Game/Dungeon/CraftingHandler.cs @@ -43,8 +43,9 @@ public class CraftingHandler // Build ingredient hash lookup for recipe discovery foreach (var recipe in recipes) { - var hash = GetIngredientHash(recipe.Ingredients.OrderBy(i => i.SlotOrder).ToList()); + var hash = GetIngredientHash(recipe.Ingredients.ToList()); _ingredientHashToRecipeId[hash] = recipe.Id; + _log.LogDebug("Recipe {Name} (ID {Id}) hash: {Hash}", recipe.Name, recipe.Id, hash); } _recipesLoaded = true; @@ -143,8 +144,13 @@ public class CraftingHandler var sortedIngredients = ingredients.OrderBy(i => i.ItemDefinitionId).ThenBy(i => i.Quantity).ToList(); var hash = GetIngredientHashFromInput(sortedIngredients); + _log.LogInformation("Discovery attempt - Hash: {Hash}, SkillFilter: {Skill}, Ingredients: {Ing}", + hash, skillTypeFilter, string.Join(", ", ingredients.Select(i => $"{i.ItemDefinitionId}x{i.Quantity}"))); + if (!_ingredientHashToRecipeId.TryGetValue(hash, out var recipeId)) { + _log.LogInformation("No recipe found for hash {Hash}. Known hashes: {Hashes}", + hash, string.Join(", ", _ingredientHashToRecipeId.Keys.Take(10))); return (null, false, "No recipe found for these ingredients"); }