Only build the chunk in TerrainWorld::chunk_add() if the world is in the tree.

This commit is contained in:
Relintai 2025-04-08 08:32:37 +02:00
parent d99577365c
commit 97380e3f53

View File

@ -352,7 +352,9 @@ void TerrainWorld::chunk_add(Ref<TerrainChunk> chunk, const int x, const int z)
if (!chunk->get_is_terrain_generated()) {
generation_queue_add_to(chunk);
} else {
chunk->build();
if (is_inside_tree()) {
chunk->build();
}
}
}
bool TerrainWorld::chunk_has(const int x, const int z) const {