diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-15 14:08:08 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-15 14:08:08 +0100 |
commit | bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc (patch) | |
tree | 6196e01a20769d17eb6f90bdaeccf1fe31d265b1 /src/Simulator | |
parent | Fixed the hopefully final wire self-powering bug (diff) | |
download | cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar.gz cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar.bz2 cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar.lz cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar.xz cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.tar.zst cuberite-bbcef6d6ebc8c46f99e17acf1cc7d23fe27d16cc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/RedstoneSimulator.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp index baeef404c..f036473c1 100644 --- a/src/Simulator/RedstoneSimulator.cpp +++ b/src/Simulator/RedstoneSimulator.cpp @@ -490,6 +490,13 @@ void cRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_BlockY, int a_Bl if (m_World.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) != 0) // A powered wire { + for (size_t i = 0; i < 4; i++) // Look for repeaters immediately surrounding self and try to power them + { + if (m_World.GetBlock(a_BlockX + gCrossCoords[i].x, a_BlockY + gCrossCoords[i].y, a_BlockZ + gCrossCoords[i].z) == E_BLOCK_REDSTONE_REPEATER_OFF) + { + SetBlockPowered(a_BlockX + gCrossCoords[i].x, a_BlockY + gCrossCoords[i].y, a_BlockZ + gCrossCoords[i].z, a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_REDSTONE_WIRE); + } + } // Wire still powered, power blocks beneath SetBlockPowered(a_BlockX, a_BlockY - 1, a_BlockZ, a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_REDSTONE_WIRE); SetDirectionLinkedPowered(a_BlockX, a_BlockY, a_BlockZ, BLOCK_FACE_YM, E_BLOCK_REDSTONE_WIRE); |