summaryrefslogtreecommitdiffstats
path: root/src/CraftingRecipes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CraftingRecipes.cpp')
-rw-r--r--src/CraftingRecipes.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 202fb900e..472044fa3 100644
--- a/src/CraftingRecipes.cpp
+++ b/src/CraftingRecipes.cpp
@@ -366,6 +366,7 @@ void cCraftingRecipes::ClearRecipes(void)
void cCraftingRecipes::AddRecipeLine(int a_LineNum, const AString & a_RecipeLine)
{
+ // Remove any spaces within the line:
AString RecipeLine(a_RecipeLine);
RecipeLine.erase(std::remove_if(RecipeLine.begin(), RecipeLine.end(), isspace), RecipeLine.end());
@@ -672,10 +673,10 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
if (
(itrS->x >= a_GridWidth) ||
(itrS->y >= a_GridHeight) ||
- (Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
+ (Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
(Item.m_ItemCount > a_CraftingGrid[GridID].m_ItemCount) || // not enough items
(
- (Item.m_ItemDamage > 0) && // should compare damage values?
+ (Item.m_ItemDamage >= 0) && // should compare damage values?
(Item.m_ItemDamage != a_CraftingGrid[GridID].m_ItemDamage)
)
)