diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-27 23:57:33 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-12-27 23:57:33 +0100 |
commit | d57753cd6873ac279f8de163393db2c1cc6a2a00 (patch) | |
tree | 176da607f1b633210ff6ce7a168e269122a32077 /source/cWorld.cpp | |
parent | Fixed a little error in cPacket_PlayerListItem.cpp (diff) | |
download | cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar.gz cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar.bz2 cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar.lz cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar.xz cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.tar.zst cuberite-d57753cd6873ac279f8de163393db2c1cc6a2a00.zip |
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r-- | source/cWorld.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 85f8872ec..3d984019c 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -419,13 +419,20 @@ void cWorld::Tick(float a_Dt) LockChunks();
- while( !m_pState->SpreadQueue.empty() )
+
+ int TimesSpreaded = 0;
+ while( !m_pState->SpreadQueue.empty() && TimesSpreaded < 50 ) // Spread a max of 50 times each tick, otherwise server will hang
{
cChunk* Chunk = (*m_pState->SpreadQueue.begin());
//LOG("Spreading: %p", Chunk );
Chunk->SpreadLight( Chunk->pGetSkyLight() );
Chunk->SpreadLight( Chunk->pGetLight() );
m_pState->SpreadQueue.remove( &*Chunk );
+ TimesSpreaded++;
+ }
+ if( TimesSpreaded >= 50 )
+ {
+ LOGWARN("Lots of lighting to do! At least %i chunks left!", m_pState->SpreadQueue.size() );
}
m_ChunkMap->Tick(a_Dt);
|