fix chunk regenerating
This commit is contained in:
parent
3c1c073714
commit
75e1316386
@ -245,14 +245,6 @@ void cChunkGenerator::Execute(void)
|
|||||||
LastReportTick = clock();
|
LastReportTick = clock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hack for regenerating chunks: if Y != 0, the chunk is considered invalid, even if it has its data set
|
|
||||||
if (m_ChunkSink->IsChunkValid(coords.m_ChunkX, coords.m_ChunkZ))
|
|
||||||
{
|
|
||||||
LOGD("Chunk [%d, %d] already generated, skipping generation", coords.m_ChunkX, coords.m_ChunkZ);
|
|
||||||
// Already generated, ignore request
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SkipEnabled && !m_ChunkSink->HasChunkAnyClients(coords.m_ChunkX, coords.m_ChunkZ))
|
if (SkipEnabled && !m_ChunkSink->HasChunkAnyClients(coords.m_ChunkX, coords.m_ChunkZ))
|
||||||
{
|
{
|
||||||
LOGWARNING("Chunk generator overloaded, skipping chunk [%d, %d]", coords.m_ChunkX, coords.m_ChunkZ);
|
LOGWARNING("Chunk generator overloaded, skipping chunk [%d, %d]", coords.m_ChunkX, coords.m_ChunkZ);
|
||||||
|
@ -2909,7 +2909,15 @@ void cWorld::RegenerateChunk(int a_ChunkX, int a_ChunkZ)
|
|||||||
|
|
||||||
void cWorld::GenerateChunk(int a_ChunkX, int a_ChunkZ)
|
void cWorld::GenerateChunk(int a_ChunkX, int a_ChunkZ)
|
||||||
{
|
{
|
||||||
|
if (!(m_ChunkMap->IsChunkValid(a_ChunkX, a_ChunkZ)))
|
||||||
|
{
|
||||||
|
LOGD("Chunk [%d, %d] already generated, skipping generation", a_ChunkX, a_ChunkZ);
|
||||||
|
// Already generated, ignore reques
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_Generator.QueueGenerateChunk(a_ChunkX, a_ChunkZ);
|
m_Generator.QueueGenerateChunk(a_ChunkX, a_ChunkZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ public:
|
|||||||
/** Regenerate the given chunk: */
|
/** Regenerate the given chunk: */
|
||||||
void RegenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
|
void RegenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
|
||||||
|
|
||||||
/** Generates the given chunk, if not already generated */
|
/** Generates the given chunk */
|
||||||
void GenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
|
void GenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
|
||||||
|
|
||||||
/** Queues a chunk for lighting; a_Callback is called after the chunk is lighted */
|
/** Queues a chunk for lighting; a_Callback is called after the chunk is lighted */
|
||||||
|
Loading…
Reference in New Issue
Block a user