diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-14 10:57:07 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-14 10:57:07 +0200 |
commit | 7188a1f670d3ffeb46c2e914234f2b6009c41599 (patch) | |
tree | a4a2899805e1253a97e604d62d7def70d302f1c3 /src/Simulator/IncrementalRedstoneSimulator.cpp | |
parent | Fixed order of initalisation (diff) | |
parent | Reduced cPluginManager code duplication (diff) | |
download | cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar.gz cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar.bz2 cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar.lz cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar.xz cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.tar.zst cuberite-7188a1f670d3ffeb46c2e914234f2b6009c41599.zip |
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator.cpp')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index b32a57165..eff11bd01 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -65,6 +65,7 @@ void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY, RelX = a_BlockX - a_OtherChunk->GetPosX() * cChunkDef::Width; RelZ = a_BlockZ - a_OtherChunk->GetPosZ() * cChunkDef::Width; a_OtherChunk->GetBlockTypeMeta(RelX, a_BlockY, RelZ, Block, Meta); + a_OtherChunk->SetIsRedstoneDirty(true); } else { @@ -199,6 +200,7 @@ void cIncrementalRedstoneSimulator::RedstoneAddBlock(int a_BlockX, int a_BlockY, } else { + itr->DataTwo = false; itr->Data = Block; // Update block information } return; @@ -802,11 +804,15 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeater(int a_RelBlockX, int { if (a_Itr->a_RelBlockPos == Vector3i(a_RelBlockX, a_RelBlockY, a_RelBlockZ)) { + // Leave a_Itr at where we found the entry break; } } } + // a_Itr may be passed with m_RepeatersDelayList::end, however, we can guarantee this iterator is always valid because... + // ...QueueRepeaterPowerChange is called to add an entry (and the above code updates iterator). However, if the repeater was locked or something similar... + // ...we will never get here because of the returns. if (a_Itr->a_ElapsedTicks >= a_Itr->a_DelayTicks) // Has the elapsed ticks reached the target ticks? { if (a_Itr->ShouldPowerOn) |