diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-04-27 15:35:27 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-04-27 15:35:27 +0200 |
commit | 57b8ee9163181920b634e475c781fe7764e11b98 (patch) | |
tree | 7d0675f8cda49a39b0b42eaaa928cfb66b57869a /src/BlockEntities/DispenserEntity.cpp | |
parent | Implemented Chunk Sparsing with segments (diff) | |
parent | Merge pull request #863 from mc-server/chunkysparsing (diff) | |
download | cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.gz cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.bz2 cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.lz cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.xz cuberite-57b8ee9163181920b634e475c781fe7764e11b98.tar.zst cuberite-57b8ee9163181920b634e475c781fe7764e11b98.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); } } |