Fix empty result when a generator is used with an empty stream in VoxelLodTerrain
This commit is contained in:
parent
151b795357
commit
2d98510543
@ -63,7 +63,8 @@ void LoadBlockDataTask::run(zylann::ThreadedTaskContext ctx) {
|
||||
if (voxel_query_data.result == VoxelStream::RESULT_ERROR) {
|
||||
ERR_PRINT("Error loading voxel block");
|
||||
|
||||
} else if (voxel_query_data.result == VoxelStream::RESULT_BLOCK_NOT_FOUND && _generate_cache_data) {
|
||||
} else if (voxel_query_data.result == VoxelStream::RESULT_BLOCK_NOT_FOUND) {
|
||||
if (_generate_cache_data) {
|
||||
Ref<VoxelGenerator> generator = _stream_dependency->generator;
|
||||
|
||||
if (generator.is_valid()) {
|
||||
@ -85,6 +86,9 @@ void LoadBlockDataTask::run(zylann::ThreadedTaskContext ctx) {
|
||||
// end up in the volume and that can cause errors.
|
||||
// TODO Define format on volume?
|
||||
}
|
||||
} else {
|
||||
_voxels.reset();
|
||||
}
|
||||
}
|
||||
|
||||
if (_request_instances && stream->supports_instance_blocks()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user