From 5a18b9b6b7d20abae3c82e0806ed396d273d5b2b Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Sat, 22 Jun 2013 08:42:49 +0000 Subject: TNT changes to primed TNT when powered by redstone. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1618 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Simulator/RedstoneSimulator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/Simulator') 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); -- cgit v1.2.3