From 619ec8b247e71a194035fe6dadb2f414a727eaec Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 28 Feb 2013 13:39:20 +0000 Subject: Converted simulators to take cWorld reference instead of a pointer git-svn-id: http://mc-server.googlecode.com/svn/trunk@1228 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Simulator/SandSimulator.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/Simulator/SandSimulator.cpp') 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 ); } } -- cgit v1.2.3