Allow the level generator to be null, without failing.

This commit is contained in:
Relintai 2020-04-22 12:21:50 +02:00
parent a34ceedf6a
commit efd08f69bf

View File

@ -757,9 +757,9 @@ VoxelWorld ::~VoxelWorld() {
void VoxelWorld::_generate_chunk(Ref<VoxelChunk> chunk) { void VoxelWorld::_generate_chunk(Ref<VoxelChunk> chunk) {
ERR_FAIL_COND(!chunk.is_valid()); ERR_FAIL_COND(!chunk.is_valid());
ERR_FAIL_COND(!_level_generator.is_valid());
_level_generator->generate_chunk(chunk); if (_level_generator.is_valid())
_level_generator->generate_chunk(chunk);
for (int i = 0; i < _voxel_structures.size(); ++i) { for (int i = 0; i < _voxel_structures.size(); ++i) {
Ref<VoxelStructure> structure = _voxel_structures.get(i); Ref<VoxelStructure> structure = _voxel_structures.get(i);