summaryrefslogtreecommitdiffstats
path: root/src/Simulator/SimulatorManager.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-07-29 01:12:45 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-02 16:52:06 +0200
commit99856df6869d32731e6fdcfeb1460297410f5820 (patch)
treec93afdb7dac377ff6c04732190a3efbe3a091c4b /src/Simulator/SimulatorManager.cpp
parentDo not impose redstone wakup penalty for all blocks (diff)
downloadcuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.gz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.bz2
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.lz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.xz
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.zst
cuberite-99856df6869d32731e6fdcfeb1460297410f5820.zip
Diffstat (limited to '')
-rw-r--r--src/Simulator/SimulatorManager.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/Simulator/SimulatorManager.cpp b/src/Simulator/SimulatorManager.cpp
index a2740f707..f10c285e0 100644
--- a/src/Simulator/SimulatorManager.cpp
+++ b/src/Simulator/SimulatorManager.cpp
@@ -2,6 +2,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "SimulatorManager.h"
+#include "../Chunk.h"
#include "../World.h"
@@ -58,11 +59,13 @@ void cSimulatorManager::SimulateChunk(std::chrono::milliseconds a_Dt, int a_Chun
-void cSimulatorManager::WakeUp(Vector3i a_Block, cChunk * a_Chunk)
+void cSimulatorManager::WakeUp(cChunk & a_Chunk, Vector3i a_Position)
{
+ ASSERT(a_Chunk.IsValid());
+
for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr)
{
- itr->first->WakeUp(a_Block, a_Chunk);
+ itr->first->WakeUp(a_Chunk, a_Position, a_Chunk.GetBlock(a_Position));
}
}
@@ -70,11 +73,11 @@ void cSimulatorManager::WakeUp(Vector3i a_Block, cChunk * a_Chunk)
-void cSimulatorManager::WakeUpArea(const cCuboid & a_Area)
+void cSimulatorManager::WakeUp(const cCuboid & a_Area)
{
- for (cSimulators::iterator itr = m_Simulators.begin(); itr != m_Simulators.end(); ++itr)
+ for (const auto Item : m_Simulators)
{
- itr->first->WakeUpArea(a_Area);
+ Item.first->WakeUp(a_Area);
}
}
@@ -86,7 +89,3 @@ void cSimulatorManager::RegisterSimulator(cSimulator * a_Simulator, int a_Rate)
{
m_Simulators.push_back(std::make_pair(a_Simulator, a_Rate));
}
-
-
-
-