From dd1df3b6f740fad699855de26d3f7f512008671b Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 18 Dec 2014 00:22:46 +0000 Subject: [PATCH] Fix repeater unpowering --- src/Simulator/IncrementalRedstoneSimulator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index 8a56287a81..544a0689d8 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -2074,9 +2074,11 @@ void cIncrementalRedstoneSimulator::SetSourceUnpowered(int a_RelSourceX, int a_R for (const auto & itr : BlocksPotentiallyUnpowered) { - if (!AreCoordsPowered(itr.x, itr.y, itr.z)) + auto Neighbour = a_Chunk->GetRelNeighborChunk(itr.x, itr.z); + if (!AreCoordsPowered(itr.x, itr.y, itr.z) && (Neighbour->GetBlock(itr) != E_BLOCK_REDSTONE_REPEATER_ON)) { - SetSourceUnpowered(itr.x, itr.y, itr.z, a_Chunk->GetRelNeighborChunk(itr.x, itr.z)); + // Repeaters time themselves with regards to unpowering; ensure we don't do it for them + SetSourceUnpowered(itr.x, itr.y, itr.z, Neighbour); } } }