summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
diff options
context:
space:
mode:
authorMarvin Kopf <marvinkopf@posteo.de>2016-02-07 15:27:24 +0100
committerMarvin Kopf <marvinkopf@posteo.de>2016-02-09 22:19:29 +0100
commitaf514acd8c4af3ed1fb03fae3c0c612d7e472a7c (patch)
treec4ebfd7a0b1bf673ae9b12b0efa308c8bdae7763 /src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
parentMerge pull request #2981 from Drahoslav7/master (diff)
downloadcuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar.gz
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar.bz2
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar.lz
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar.xz
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.tar.zst
cuberite-af514acd8c4af3ed1fb03fae3c0c612d7e472a7c.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
index 3c79d152b..0e9621910 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp
@@ -125,8 +125,11 @@ void cIncrementalRedstoneSimulator::Simulate(float a_dt)
}
auto CurrentHandler = cIncrementalRedstoneSimulator::CreateComponent(m_World, CurrentBlock, &m_Data);
- if (CurrentHandler == nullptr)
+ if (CurrentHandler == nullptr) // Block at CurrentPosition doesn't have a corresponding redstone handler
{
+ // Clean up cached PowerData for CurrentPosition
+ static_cast<cIncrementalRedstoneSimulator *>(m_World.GetRedstoneSimulator())->GetChunkData()->ErasePowerData(CurrentLocation);
+
continue;
}