summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-22 16:05:02 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-22 16:05:02 +0200
commitc13cffcd30da6b7f4e040de935d5958a30326f8c (patch)
tree7967052d180cad38d4c10981241f9b98ec5000b9 /src/Simulator
parentFixed another daylight sensor bug (diff)
parentFixed missing break (diff)
downloadcuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar.gz
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar.bz2
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar.lz
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar.xz
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.tar.zst
cuberite-c13cffcd30da6b7f4e040de935d5958a30326f8c.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index a54867171..1de0d2c34 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -348,6 +348,7 @@ void cIncrementalRedstoneSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int
case E_BLOCK_REDSTONE_REPEATER_ON:
{
HandleRedstoneRepeater(dataitr->x, dataitr->y, dataitr->z, dataitr->Data);
+ break;
}
case E_BLOCK_REDSTONE_TORCH_OFF:
case E_BLOCK_REDSTONE_TORCH_ON:
@@ -763,7 +764,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeater(int a_RelBlockX, int
void cIncrementalRedstoneSimulator::HandleRedstoneRepeaterDelays()
{
- for (RepeatersDelayList::iterator itr = m_RepeatersDelayList->begin(); itr != m_RepeatersDelayList->end(); itr++)
+ for (RepeatersDelayList::iterator itr = m_RepeatersDelayList->begin(); itr != m_RepeatersDelayList->end();)
{
if (itr->a_ElapsedTicks >= itr->a_DelayTicks) // Has the elapsed ticks reached the target ticks?
@@ -809,7 +810,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeaterDelays()
{
m_Chunk->SetBlock(RelBlockX, RelBlockY, RelBlockZ, E_BLOCK_REDSTONE_REPEATER_OFF, Meta);
}
- m_RepeatersDelayList->erase(itr);
+ itr = m_RepeatersDelayList->erase(itr);
}
else
{
@@ -818,6 +819,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneRepeaterDelays()
// I am confounded to say why. Perhaps optimisation failure.
LOGD("Incremented a repeater @ {%i %i %i} | Elapsed ticks: %i | Target delay: %i", itr->a_RelBlockPos.x, itr->a_RelBlockPos.y, itr->a_RelBlockPos.z, itr->a_ElapsedTicks, itr->a_DelayTicks);
itr->a_ElapsedTicks++;
+ itr++;
}
}
}