summaryrefslogtreecommitdiffstats
path: root/source/Simulator/SandSimulator.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-28 14:39:20 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-28 14:39:20 +0100
commit619ec8b247e71a194035fe6dadb2f414a727eaec (patch)
tree7e1b03afb1d4d4000ea9c059c91b62b66bf0c305 /source/Simulator/SandSimulator.cpp
parentSimulators now have direct access to the cChunk object in the WakeUp() call (diff)
downloadcuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar.gz
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar.bz2
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar.lz
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar.xz
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.tar.zst
cuberite-619ec8b247e71a194035fe6dadb2f414a727eaec.zip
Diffstat (limited to '')
-rw-r--r--source/Simulator/SandSimulator.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/Simulator/SandSimulator.cpp b/source/Simulator/SandSimulator.cpp
index f9d58f030..04bcc498c 100644
--- a/source/Simulator/SandSimulator.cpp
+++ b/source/Simulator/SandSimulator.cpp
@@ -12,7 +12,7 @@
-cSandSimulator::cSandSimulator( cWorld* a_World )
+cSandSimulator::cSandSimulator(cWorld & a_World)
: cSimulator(a_World)
, m_Blocks(new BlockList)
, m_Buffer(new BlockList)
@@ -34,7 +34,7 @@ cSandSimulator::~cSandSimulator()
-void cSandSimulator::Simulate( float a_Dt )
+void cSandSimulator::Simulate(float a_Dt)
{
m_Buffer->clear();
std::swap( m_Blocks, m_Buffer );
@@ -42,17 +42,17 @@ void cSandSimulator::Simulate( float a_Dt )
for( BlockList::iterator itr = m_Buffer->begin(); itr != m_Buffer->end(); ++itr )
{
Vector3i Pos = *itr;
- BLOCKTYPE BlockID = m_World->GetBlock(Pos.x, Pos.y, Pos.z);
+ BLOCKTYPE BlockID = m_World.GetBlock(Pos.x, Pos.y, Pos.z);
if(!IsAllowedBlock(BlockID))
continue;
- BLOCKTYPE BottomBlock = m_World->GetBlock( Pos.x, Pos.y - 1, Pos.z );
+ BLOCKTYPE BottomBlock = m_World.GetBlock( Pos.x, Pos.y - 1, Pos.z );
if( IsPassable(BottomBlock) )
{
- cFallingBlock * FallingBlock = new cFallingBlock( Pos, BlockID );
- FallingBlock->Initialize( m_World );
- m_World->SetBlock( Pos.x, Pos.y, Pos.z, E_BLOCK_AIR, 0 );
+ cFallingBlock * FallingBlock = new cFallingBlock(Pos, BlockID);
+ FallingBlock->Initialize(&m_World);
+ m_World.SetBlock( Pos.x, Pos.y, Pos.z, E_BLOCK_AIR, 0 );
}
}