From c153a5c6df9a86cc443f356c00c4c0e0bee6453a Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Sat, 22 Jun 2013 10:03:41 +0000 Subject: Dispensers spawn fire if it has Flint and steel. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1619 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/BlockEntities/DispenserEntity.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/BlockEntities/DispenserEntity.cpp b/source/BlockEntities/DispenserEntity.cpp index 22fcdd3fc..ab4c8e519 100644 --- a/source/BlockEntities/DispenserEntity.cpp +++ b/source/BlockEntities/DispenserEntity.cpp @@ -131,6 +131,22 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum) } break; } + + case E_ITEM_FLINT_AND_STEEL: + { + // Spawn fire if the block in front is air. + 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) + { + m_Contents.ChangeSlotCount(a_SlotNum, -1); + } + } + break; + } default: { -- cgit v1.2.3