summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authoradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-09 02:31:19 +0100
committeradmin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-09 02:31:19 +0100
commit744c0187ba3413d29c008f8ff5177f54540bf65b (patch)
treef31055885dceea455f94b0e2d85c8d2fc2fc9edf /source/cWorld.cpp
parentBroke something in the filters file, fixed now (diff)
downloadcuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.gz
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.bz2
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.lz
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.xz
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.tar.zst
cuberite-744c0187ba3413d29c008f8ff5177f54540bf65b.zip
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r--source/cWorld.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index f372eb69d..ce5f2ed7a 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -1,5 +1,6 @@
#include "BlockID.h"
#include "cWorld.h"
+#include "cRedstone.h"
#include "cChunk.h"
#include "cClientHandle.h"
#include "cPickup.h"
@@ -112,6 +113,7 @@ cWorld::~cWorld()
cWorld::cWorld( const char* a_WorldName )
: m_pState( new sWorldState )
, m_SpawnMonsterTime( 0.f )
+ , m_RSList ( 0 )
{
LOG("cWorld::cWorld(%s)", a_WorldName);
m_pState->WorldName = a_WorldName;
@@ -435,6 +437,39 @@ void cWorld::Tick(float a_Dt)
}
}
}
+
+
+
+ std::vector<int> m_RSList_copy(m_RSList);
+ //copy(m_RSList.begin(), m_RSList.end(), m_RSList_copy.begin());
+ m_RSList.erase(m_RSList.begin(),m_RSList.end());
+ int tempX;
+ int tempY;
+ int tempZ;
+ int state;
+
+ std::vector<int>::const_iterator cii;
+ for(cii=m_RSList_copy.begin(); cii!=m_RSList_copy.end();)
+ {
+ tempX = *cii;cii++;
+ tempY = *cii;cii++;
+ tempZ = *cii;cii++;
+ state = *cii;cii++;
+
+ //printf ("%i, %i, %i, %i\n",tempX,tempY,tempZ,state) ;
+ if ( (state == 00000) && ( (int)GetBlock( tempX, tempY, tempZ ) == E_BLOCK_REDSTONE_TORCH_OFF ) ) {
+ FastSetBlock( tempX, tempY, tempZ, E_BLOCK_REDSTONE_TORCH_OFF, (int)GetBlockMeta( tempX, tempY, tempZ ) );
+ cRedstone Redstone(this);
+ Redstone.ChangeRedstone( tempX, tempY, tempZ, false );
+ } else if ( (state == 11111) && ( (int)GetBlock( tempX, tempY, tempZ ) == E_BLOCK_REDSTONE_TORCH_ON ) ) {
+ FastSetBlock( tempX, tempY, tempZ, E_BLOCK_REDSTONE_TORCH_ON, (int)GetBlockMeta( tempX, tempY, tempZ ) );
+ cRedstone Redstone(this);
+ Redstone.ChangeRedstone( tempX, tempY, tempZ, true );
+ }
+
+ }
+ m_RSList_copy.erase(m_RSList_copy.begin(),m_RSList_copy.end());
+
}
void cWorld::GrowTree( int a_X, int a_Y, int a_Z )