[ClientChunk] Only start meshing if all neighbours are initialized.
This commit is contained in:
parent
d6d5717a43
commit
bfc78434f5
@ -56,11 +56,13 @@ void ClientChunk::update() {
|
||||
}
|
||||
|
||||
void ClientChunk::process() {
|
||||
m_verticesCount = m_builder.buildChunk(*this, m_vbo);
|
||||
if (m_isReadyForMeshing) {
|
||||
m_verticesCount = m_builder.buildChunk(*this, m_vbo);
|
||||
|
||||
++ClientChunk::chunkUpdateCounter;
|
||||
++ClientChunk::chunkUpdateCounter;
|
||||
|
||||
m_lastMeshingTime = gk::GameClock::getInstance().getTicks(true);
|
||||
m_lastMeshingTime = gk::GameClock::getInstance().getTicks(true);
|
||||
}
|
||||
}
|
||||
|
||||
void ClientChunk::onBlockPlaced(int x, int y, int z, const Block &) {
|
||||
|
@ -84,7 +84,7 @@ void ClientWorld::requestClosestChunkMeshing() {
|
||||
// If we have a chunk marked for initialization
|
||||
if (ud < 1000000.0) {
|
||||
ClientChunk *chunk = (ClientChunk *)getChunk(ux, uy, uz);
|
||||
if(chunk && !chunk->isReadyForMeshing()) {
|
||||
if(chunk && !chunk->isReadyForMeshing() && chunk->areAllNeighboursInitialized()) {
|
||||
chunk->setReadyForMeshing(true);
|
||||
chunk->setChanged();
|
||||
addChunkToUpdate(chunk);
|
||||
|
Loading…
x
Reference in New Issue
Block a user