diff options
author | Mattes D <github@xoft.cz> | 2014-04-22 13:34:32 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-04-22 13:34:32 +0200 |
commit | 6492aa000b322877aecda32573cc55b57abfc5ed (patch) | |
tree | f9f0f9211b42aa72729f8d6d444e4f48556e5fb9 /src/BlockEntities/DispenserEntity.cpp | |
parent | Added prefab hitboxes. (diff) | |
parent | reverted the revert of the minecart collision detection fix. (diff) | |
download | cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.gz cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.bz2 cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.lz cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.xz cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.tar.zst cuberite-6492aa000b322877aecda32573cc55b57abfc5ed.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/DispenserEntity.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp index e03bf776d..2a32f69d9 100644 --- a/src/BlockEntities/DispenserEntity.cpp +++ b/src/BlockEntities/DispenserEntity.cpp @@ -128,10 +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); - m_Contents.SetSlot(a_SlotNum, m_Contents.GetSlot(a_SlotNum).m_ItemType, m_Contents.GetSlot(a_SlotNum).m_ItemCount, m_Contents.GetSlot(a_SlotNum).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); } } |