From 9f77572fb0d045229556314ba9d7aa0f52ad5635 Mon Sep 17 00:00:00 2001 From: "lapayo94@gmail.com" Date: Mon, 26 Dec 2011 20:57:12 +0000 Subject: - improved Simulator system -> Manager handles all ticks -> advantage: Much easier to add new simulators, because you only have to register them in the manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - moved sand and gravel simulation to a Simulator-class (cSandSimulator) - Made Squid a little bit more funny and realistic, because it dies now when it´s not in water -Escaping mobs run now faster than normal (They just walked away before :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@125 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cFluidSimulator.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'source/cFluidSimulator.cpp') diff --git a/source/cFluidSimulator.cpp b/source/cFluidSimulator.cpp index 6eb5dbb0a..2ede7ba49 100644 --- a/source/cFluidSimulator.cpp +++ b/source/cFluidSimulator.cpp @@ -72,7 +72,7 @@ public: }; cFluidSimulator::cFluidSimulator( cWorld* a_World ) - : m_World(a_World) + : cSimulator(a_World) , m_Data(0) { m_Data = new FluidData(a_World, this); @@ -80,17 +80,7 @@ cFluidSimulator::cFluidSimulator( cWorld* a_World ) cFluidSimulator::~cFluidSimulator() { -} - -void cFluidSimulator::WakeUp( int a_X, int a_Y, int a_Z ) -{ - AddBlock( a_X, a_Y, a_Z ); - AddBlock( a_X-1, a_Y, a_Z ); - AddBlock( a_X+1, a_Y, a_Z ); - AddBlock( a_X, a_Y-1, a_Z ); - AddBlock( a_X, a_Y+1, a_Z ); - AddBlock( a_X, a_Y, a_Z-1 ); - AddBlock( a_X, a_Y, a_Z+1 ); + delete m_Data; } void cFluidSimulator::AddBlock( int a_X, int a_Y, int a_Z ) @@ -99,8 +89,8 @@ void cFluidSimulator::AddBlock( int a_X, int a_Y, int a_Z ) std::vector< Vector3i > & ActiveFluid = *m_Data->m_ActiveFluid; for( std::vector< Vector3i >::iterator itr = ActiveFluid.begin(); itr != ActiveFluid.end(); ++itr ) { - Vector3i & pos = *itr; - if( pos.x == a_X && pos.y == a_Y && pos.z == a_Z ) + Vector3i & Pos = *itr; + if( Pos.x == a_X && Pos.y == a_Y && Pos.z == a_Z ) return; } -- cgit v1.2.3