summaryrefslogtreecommitdiffstats
path: root/source/BlockEntities/DispenserEntity.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-21 23:19:47 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-21 23:19:47 +0200
commite2281df8d8200973706c19bc512f2e3ec70d765b (patch)
treeed871b9256f7ea55b2f64e95a263759cb2be29f4 /source/BlockEntities/DispenserEntity.cpp
parentExplosions don't produce warnings in cBlockArea; fixed logging in cBlockArea (diff)
downloadcuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar.gz
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar.bz2
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar.lz
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar.xz
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.tar.zst
cuberite-e2281df8d8200973706c19bc512f2e3ec70d765b.zip
Diffstat (limited to 'source/BlockEntities/DispenserEntity.cpp')
-rw-r--r--source/BlockEntities/DispenserEntity.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/BlockEntities/DispenserEntity.cpp b/source/BlockEntities/DispenserEntity.cpp
index 08f26efff..22fcdd3fc 100644
--- a/source/BlockEntities/DispenserEntity.cpp
+++ b/source/BlockEntities/DispenserEntity.cpp
@@ -119,6 +119,19 @@ void cDispenserEntity::DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum)
break;
}
+ case E_BLOCK_TNT:
+ {
+ // Spawn a primed TNT entity, if space allows:
+ if (DispChunk->GetBlock(DispX, DispY, DispZ) == E_BLOCK_AIR)
+ {
+ double TNTX = 0.5 + (DispX + DispChunk->GetPosX() * cChunkDef::Width);
+ double TNTZ = 0.5 + (DispZ + DispChunk->GetPosZ() * cChunkDef::Width);
+ m_World->SpawnPrimedTNT(TNTX, DispY + 0.5, TNTZ, 4, 0); // 4 seconds fuse, no initial velocity
+ m_Contents.ChangeSlotCount(a_SlotNum, -1);
+ }
+ break;
+ }
+
default:
{
DropFromSlot(a_Chunk, a_SlotNum);