1
0

CraftingRecipes parse now dumps lines it cannot parse.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1052 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-11-18 13:09:13 +00:00
parent 18b73e471f
commit fcdaaae64b

View File

@ -363,6 +363,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine
if (Sides.size() != 2) if (Sides.size() != 2)
{ {
LOGWARNING("crafting.txt: line %d: A single '=' was expected, got %d", a_LineNum, (int)Sides.size() - 1); 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; return;
} }
@ -373,11 +374,13 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine
if (ResultSplit.empty()) if (ResultSplit.empty())
{ {
LOGWARNING("crafting.txt: line %d: Result is empty, ignoring the recipe.", a_LineNum); LOGWARNING("crafting.txt: line %d: Result is empty, ignoring the recipe.", a_LineNum);
LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str());
return; return;
} }
if (!ParseItem(ResultSplit[0], Recipe->m_Result)) if (!ParseItem(ResultSplit[0], Recipe->m_Result))
{ {
LOGWARNING("crafting.txt: line %d: Cannot parse result item, ignoring the recipe.", a_LineNum); LOGWARNING("crafting.txt: line %d: Cannot parse result item, ignoring the recipe.", a_LineNum);
LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str());
return; return;
} }
if (ResultSplit.size() > 1) 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) if (Recipe->m_Result.m_ItemCount == 0)
{ {
LOGWARNING("crafting.txt: line %d: Cannot parse result count, ignoring the recipe.", a_LineNum); LOGWARNING("crafting.txt: line %d: Cannot parse result count, ignoring the recipe.", a_LineNum);
LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str());
return; return;
} }
} }
@ -402,6 +406,7 @@ void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine
if (!ParseIngredient(*itr, Recipe.get())) if (!ParseIngredient(*itr, Recipe.get()))
{ {
LOGWARNING("crafting.txt: line %d: Cannot parse ingredient #%d, ignoring the recipe.", a_LineNum, Num); LOGWARNING("crafting.txt: line %d: Cannot parse ingredient #%d, ignoring the recipe.", a_LineNum, Num);
LOGINFO("Offending line: \"%s\"", a_RecipeLine.c_str());
return; return;
} }
} // for itr - Ingredients[] } // for itr - Ingredients[]