From d57753cd6873ac279f8de163393db2c1cc6a2a00 Mon Sep 17 00:00:00 2001 From: faketruth Date: Tue, 27 Dec 2011 22:57:33 +0000 Subject: Users file was pretty messed up with mixed unix and windows line endings. The ini failed to parse correctly under cygwin. 'Fixed' a 'bug' where MCServer would seemingly endlessly calculate lighting for an entire world (and then crash), when this entire world has 'wrong' lighting. This happens when running a converted map from Vanilla. Fixed this by only allowing a maximum of 50 chunks to recalculate their lighting per tick. Fixed a small coding error in cChunkMap where it would check PakVersion twice, instead of also ChunkVersion. DeNotch converter does not need the VS2010 runtime thingies anymore git-svn-id: http://mc-server.googlecode.com/svn/trunk@138 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/cWorld.cpp') 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); -- cgit v1.2.3