summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/DispenserEntity.cpp
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-19 20:51:52 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-19 20:51:52 +0200
commitf48d43f050683488b4cdbddcc92cfc7804112c11 (patch)
tree1fb33ed7227f1099851338937a5c658368774f01 /src/BlockEntities/DispenserEntity.cpp
parentDeclared one mutex as mutable in order to allow for const correct get accessors. (diff)
downloadcuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.gz
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.bz2
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.lz
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.xz
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.tar.zst
cuberite-f48d43f050683488b4cdbddcc92cfc7804112c11.zip
Diffstat (limited to 'src/BlockEntities/DispenserEntity.cpp')
-rw-r--r--src/BlockEntities/DispenserEntity.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp
index f5b9c8923..2a32f69d9 100644
--- a/src/BlockEntities/DispenserEntity.cpp
+++ b/src/BlockEntities/DispenserEntity.cpp
@@ -128,11 +128,11 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
if (DispChunk->GetBlock(DispX, DispY, DispZ) == E_BLOCK_AIR)
{
DispChunk->SetBlock(DispX, DispY, DispZ, E_BLOCK_FIRE, 0);
- const cItem& slot = m_Contents.GetSlot(a_SlotNum);
- m_Contents.SetSlot(a_SlotNum, slot.m_ItemType, slot.m_ItemCount, slot.m_ItemDamage + 1);
- // If the durability has run out destroy the item.
- if (m_Contents.GetSlot(a_SlotNum).m_ItemDamage > 64)
- {
+
+ bool ItemBroke = m_Contents.DamageItem(a_SlotNum, 1);
+
+ if (ItemBroke)
+ {
m_Contents.ChangeSlotCount(a_SlotNum, -1);
}
}