summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2014-04-08 08:37:26 +0200
committerAlexander Harkness <bearbin@gmail.com>2014-04-08 08:37:26 +0200
commit8d251601cfe3d9693c0b591fb665f7fd525e081d (patch)
treec8d581a9be30502938287ec6474ce96e8fbe3218
parentMerge pull request #865 from wiseoldman95/patch-2 (diff)
parentFixed #859 (diff)
downloadcuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar.gz
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar.bz2
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar.lz
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar.xz
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.tar.zst
cuberite-8d251601cfe3d9693c0b591fb665f7fd525e081d.zip
-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 8f82c454e..fc239169c 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -95,26 +95,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();
@@ -557,8 +537,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
@@ -588,9 +568,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
}