summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-02 23:25:18 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-04 13:44:03 +0200
commitec2f576de69f2a6e73abb1aeadb173c0b2e12131 (patch)
tree2106f0f9f9edccf5452134ed3ead93b5ebd9812f /src/Simulator/IncrementalRedstoneSimulator.cpp
parentRemoved world-saving log messages. (diff)
downloadcuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar.gz
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar.bz2
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar.lz
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar.xz
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.tar.zst
cuberite-ec2f576de69f2a6e73abb1aeadb173c0b2e12131.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator.cpp')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index 866a5b65a..5af9a295d 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -1700,7 +1700,7 @@ bool cIncrementalRedstoneSimulator::IsWirePowered(int a_RelBlockX, int a_RelBloc
{
continue;
}
- a_PowerLevel = itr->a_PowerLevel;
+ a_PowerLevel = std::max(itr->a_PowerLevel , a_PowerLevel); // Get the highest power level (a_PowerLevel is initialised already and there CAN be multiple levels for one block)
}
for (LinkedBlocksList::const_iterator itr = m_LinkedPoweredBlocks->begin(); itr != m_LinkedPoweredBlocks->end(); ++itr) // Check linked powered list
@@ -1709,7 +1709,7 @@ bool cIncrementalRedstoneSimulator::IsWirePowered(int a_RelBlockX, int a_RelBloc
{
continue;
}
- a_PowerLevel = itr->a_PowerLevel;
+ a_PowerLevel = std::max(itr->a_PowerLevel, a_PowerLevel);
}
return (a_PowerLevel != 0); // Answer the inital question: is the wire powered?