Removed the temp mesh array I just added from voxel chunk.

This commit is contained in:
Relintai 2020-03-06 14:27:04 +01:00
parent 656f0ba9fa
commit 370e14f6c8
2 changed files with 5 additions and 11 deletions

View File

@ -780,18 +780,15 @@ void VoxelChunk::_build_phase(int phase) {
ERR_FAIL_COND(!mesher.is_valid());
temp_mesh_arr = mesher->build_mesh();
if (mesher->get_vertex_count() == 0) {
next_phase();
return;
}
if (_mesh_rid != RID())
VS::get_singleton()->mesh_clear(_mesh_rid);
PoolVector3Array v = temp_mesh_arr[VisualServer::ARRAY_VERTEX];
if (temp_mesh_arr.size() == 0 || v.size() == 0) {
temp_mesh_arr.clear();
next_phase();
return;
}
Array temp_mesh_arr = mesher->build_mesh();
if (_mesh_rid == RID()) {
allocate_main_mesh();
@ -802,8 +799,6 @@ void VoxelChunk::_build_phase(int phase) {
if (_library->get_material().is_valid())
VS::get_singleton()->mesh_surface_set_material(_mesh_rid, 0, _library->get_material()->get_rid());
temp_mesh_arr.clear();
next_phase();
return;

View File

@ -393,7 +393,6 @@ protected:
Mutex *_build_phase_done_mutex;
bool _build_phase_done;
Thread *_build_thread;
Array temp_mesh_arr;
};
VARIANT_ENUM_CAST(VoxelChunk::DefaultChannels);