From fcdaaae64b5efb90989c48832f26de536453da9c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 18 Nov 2012 13:09:13 +0000 Subject: CraftingRecipes parse now dumps lines it cannot parse. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1052 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/CraftingRecipes.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') diff --git a/source/CraftingRecipes.cpp b/source/CraftingRecipes.cpp index 4cf503b3a..a48e777b5 100644 --- a/source/CraftingRecipes.cpp +++ b/source/CraftingRecipes.cpp @@ -363,6 +363,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine if (Sides.size() != 2) { LOGWARNING("crafting.txt: line %d: A single '=' was expected, got %d", a_LineNum, (int)Sides.size() - 1); + LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str()); return; } @@ -373,11 +374,13 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine if (ResultSplit.empty()) { LOGWARNING("crafting.txt: line %d: Result is empty, ignoring the recipe.", a_LineNum); + LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str()); return; } if (!ParseItem(ResultSplit[0], Recipe->m_Result)) { LOGWARNING("crafting.txt: line %d: Cannot parse result item, ignoring the recipe.", a_LineNum); + LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str()); return; } if (ResultSplit.size() > 1) @@ -386,6 +389,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine if (Recipe->m_Result.m_ItemCount == 0) { LOGWARNING("crafting.txt: line %d: Cannot parse result count, ignoring the recipe.", a_LineNum); + LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str()); return; } } @@ -402,6 +406,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine if (!ParseIngredient(*itr, Recipe.get())) { LOGWARNING("crafting.txt: line %d: Cannot parse ingredient #%d, ignoring the recipe.", a_LineNum, Num); + LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str()); return; } } // for itr - Ingredients[] -- cgit v1.2.3