summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-07 13:02:41 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-07 13:02:41 +0200
commit440b74af6cae6c93075f622c815f9e2cf518362e (patch)
tree352da614fb27c0a9e0df887bb81cece36dbec68a /src/Simulator/IncrementalRedstoneSimulator.cpp
parentAPIDump: Added angular specifics. (diff)
downloadcuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar.gz
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar.bz2
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar.lz
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar.xz
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.tar.zst
cuberite-440b74af6cae6c93075f622c815f9e2cf518362e.zip
Diffstat (limited to '')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index 92659fab7..86462f4cb 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -96,26 +96,6 @@ void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY,
PoweredBlocks->erase(itr);
break;
}
- else if (Block == E_BLOCK_DAYLIGHT_SENSOR)
- {
- if (!a_Chunk->IsLightValid())
- {
- m_World.QueueLightChunk(a_Chunk->GetPosX(), a_Chunk->GetPosZ());
- break;
- }
- else
- {
- NIBBLETYPE SkyLight;
- a_Chunk->UnboundedRelGetBlockSkyLight(RelX, itr->a_SourcePos.y + 1, RelZ, SkyLight);
-
- if (a_Chunk->GetTimeAlteredLight(SkyLight) <= 8) // Could use SkyLight - m_World.GetSkyDarkness();
- {
- LOGD("cIncrementalRedstoneSimulator: Erased daylight sensor from powered blocks list due to insufficient light level");
- PoweredBlocks->erase(itr);
- break;
- }
- }
- }
}
LinkedBlocksList * LinkedPoweredBlocks = a_Chunk->GetRedstoneSimulatorLinkedBlocksList();
@@ -558,8 +538,8 @@ void cIncrementalRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_Block
}
else
{
- NIBBLETYPE MetaToSet = 0;
NIBBLETYPE MyMeta = m_World.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
+ NIBBLETYPE MetaToSet = MyMeta;
int TimesMetaSmaller = 0, TimesFoundAWire = 0;
for (size_t i = 0; i < ARRAYCOUNT(gCrossCoords); i++) // Loop through all directions to transfer or receive power
@@ -589,9 +569,9 @@ void cIncrementalRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_Block
if (SurroundMeta > 1) // Wires of power 1 or 0 cannot transfer power TO ME, don't bother checking
{
- // Does surrounding wire have a higher power level than self?
+ // Does surrounding wire have a higher power level than the highest so far (MetaToSet)?
// >= to fix a bug where wires bordering each other with the same power level will appear (in terms of meta) to power each other, when they aren't actually in the powered list
- if (SurroundMeta >= MyMeta)
+ if (SurroundMeta >= MetaToSet)
{
MetaToSet = SurroundMeta - 1; // To improve performance
}