used 'closes' chunks in ChunksLoader lights calculations

This commit is contained in:
MihailRis 2022-02-28 04:19:40 +03:00 committed by GitHub
parent 4651ab776b
commit 4c2fd0fce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,13 @@ void ChunksLoader::_thread(){
}
Chunk* chunk = current;
chunk->incref();
for (size_t i = 0; i < 27; i++){
Chunk* other = closes[i];
if (other){
other->incref();
chunks.putChunk(other);
}
}
chunks._setOffset(chunk->x-1, chunk->y-1, chunk->z-1);
@ -30,7 +37,8 @@ void ChunksLoader::_thread(){
chunks.clear(false);
for (int i = 0; i < 27; i++){
Chunk* other = closes[i];
//delete other;
if (other)
other->decref();
}
chunk->ready = true;
current = nullptr;