From c8fc397b431a6cd6c34aafc70796fd3ad9835488 Mon Sep 17 00:00:00 2001 From: "nielsbreu@gmail.com" Date: Sat, 22 Jun 2013 11:45:41 +0000 Subject: Made redstone lamps turn on when powered and turn off when not powered. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1620 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Simulator/RedstoneSimulator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/Simulator') diff --git a/source/Simulator/RedstoneSimulator.cpp b/source/Simulator/RedstoneSimulator.cpp index e11157c2b..6d1415265 100644 --- a/source/Simulator/RedstoneSimulator.cpp +++ b/source/Simulator/RedstoneSimulator.cpp @@ -161,6 +161,11 @@ void cRedstoneSimulator::RefreshTorchesAround(const Vector3i & a_BlockPos) 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); } + //Turn a redstone lamp on when it gets powered. + if (m_World.GetBlock(a_BlockPos) == E_BLOCK_REDSTONE_LAMP_OFF) + { + m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_REDSTONE_LAMP_ON, 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); @@ -168,6 +173,11 @@ void cRedstoneSimulator::RefreshTorchesAround(const Vector3i & a_BlockPos) } else { + //Turn a redstone lamp off when it gets powered. + if (m_World.GetBlock(a_BlockPos) == E_BLOCK_REDSTONE_LAMP_ON) + { + m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_REDSTONE_LAMP_OFF, 0); + } //if (m_World.GetBlock(a_BlockPos) == E_BLOCK_STONE) //{ // m_World.FastSetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_DIRT, 0); -- cgit v1.2.3