diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-24 19:57:25 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-04-24 19:57:25 +0200 |
commit | 48904ae201a38c4b6e018567976c00c40c2829c9 (patch) | |
tree | dfba8600b7f48e09c3c1d752b1cce1b4a45c8ea8 /src/BlockEntities/DispenserEntity.cpp | |
parent | Some change to Entity.cpp (diff) | |
parent | The new leaves don't decay anymore. (diff) | |
download | cuberite-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/BlockEntities/DispenserEntity.cpp')
-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); } } |