diff options
author | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-22 10:42:49 +0200 |
---|---|---|
committer | nielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-22 10:42:49 +0200 |
commit | 5a18b9b6b7d20abae3c82e0806ed396d273d5b2b (patch) | |
tree | 26992d83b4f03a5557c51079faf38415febbb45f /source/Simulator | |
parent | Dispensers dispense primed TNT (diff) | |
download | cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar.gz cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar.bz2 cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar.lz cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar.xz cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.tar.zst cuberite-5a18b9b6b7d20abae3c82e0806ed396d273d5b2b.zip |
Diffstat (limited to 'source/Simulator')
-rw-r--r-- | source/Simulator/RedstoneSimulator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/Simulator/RedstoneSimulator.cpp b/source/Simulator/RedstoneSimulator.cpp index 97412cca1..e11157c2b 100644 --- a/source/Simulator/RedstoneSimulator.cpp +++ b/source/Simulator/RedstoneSimulator.cpp @@ -8,6 +8,7 @@ #include "../World.h" #include "../BlockID.h" #include "../Chunk.h" +#include "../TNTEntity.h" @@ -153,6 +154,13 @@ void cRedstoneSimulator::RefreshTorchesAround(const Vector3i & a_BlockPos) { TargetBlockType = E_BLOCK_REDSTONE_TORCH_OFF; TargetRepeaterType = E_BLOCK_REDSTONE_REPEATER_ON; + //Make TNT Explode when it gets powered. + if (m_World.GetBlock(a_BlockPos) == E_BLOCK_TNT) + { + m_World.BroadcastSoundEffect("random.fuse", a_BlockPos.x * 8, a_BlockPos.y * 8, a_BlockPos.z * 8, 0.5f, 0.6f); + m_World.SpawnPrimedTNT(a_BlockPos.x + 0.5, a_BlockPos.y + 0.5, a_BlockPos.z + 0.5, 4); // 4 seconds to boom + m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_AIR, 0); + } //if (m_World.GetBlock(a_BlockPos) == E_BLOCK_DIRT) //{ // m_World.FastSetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_STONE, 0); |