summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/cWorld.cpp')
-rw-r--r--source/cWorld.cpp9
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);