summaryrefslogtreecommitdiffstats
path: root/src/CraftingRecipes.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-24 19:57:25 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-24 19:57:25 +0200
commit48904ae201a38c4b6e018567976c00c40c2829c9 (patch)
treedfba8600b7f48e09c3c1d752b1cce1b4a45c8ea8 /src/CraftingRecipes.cpp
parentSome change to Entity.cpp (diff)
parentThe new leaves don't decay anymore. (diff)
downloadcuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar.gz
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar.bz2
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar.lz
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar.xz
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.tar.zst
cuberite-48904ae201a38c4b6e018567976c00c40c2829c9.zip
Diffstat (limited to 'src/CraftingRecipes.cpp')
-rw-r--r--src/CraftingRecipes.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp
index 157d634cd..53a638ee5 100644
--- a/src/CraftingRecipes.cpp
+++ b/src/CraftingRecipes.cpp
@@ -661,14 +661,16 @@ cCraftingRecipes::cRecipe * cCraftingRecipes::MatchRecipe(const cItem * a_Crafti
ASSERT(itrS->x + a_OffsetX < a_GridWidth);
ASSERT(itrS->y + a_OffsetY < a_GridHeight);
int GridID = (itrS->x + a_OffsetX) + a_GridStride * (itrS->y + a_OffsetY);
+
+ const cItem & Item = itrS->m_Item;
if (
(itrS->x >= a_GridWidth) ||
(itrS->y >= a_GridHeight) ||
- (itrS->m_Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
- (itrS->m_Item.m_ItemCount > a_CraftingGrid[GridID].m_ItemCount) || // not enough items
+ (Item.m_ItemType != a_CraftingGrid[GridID].m_ItemType) || // same item type?
+ (Item.m_ItemCount > a_CraftingGrid[GridID].m_ItemCount) || // not enough items
(
- (itrS->m_Item.m_ItemDamage > 0) && // should compare damage values?
- (itrS->m_Item.m_ItemDamage != a_CraftingGrid[GridID].m_ItemDamage)
+ (Item.m_ItemDamage > 0) && // should compare damage values?
+ (Item.m_ItemDamage != a_CraftingGrid[GridID].m_ItemDamage)
)
)
{
@@ -824,7 +826,7 @@ void cCraftingRecipes::HandleFireworks(const cItem * a_CraftingGrid, cCraftingRe
case E_ITEM_DYE:
{
int GridID = (itr->x + a_OffsetX) + a_GridStride * (itr->y + a_OffsetY);
- DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye(a_CraftingGrid[GridID].m_ItemDamage));
+ DyeColours.push_back(cFireworkItem::GetVanillaColourCodeFromDye((NIBBLETYPE)(a_CraftingGrid[GridID].m_ItemDamage & 0x0f)));
break;
}
case E_ITEM_GUNPOWDER: break;