From 5a9b99c199edb7c7cfe53b3492d39947855175f0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 12 Oct 2020 18:53:35 +0200 Subject: [PATCH] Missing guards, and fixed an ERR_FAIL_INDEX_V. --- world/voxel_chunk.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/world/voxel_chunk.cpp b/world/voxel_chunk.cpp index 7c3f0b7..907b1f8 100644 --- a/world/voxel_chunk.cpp +++ b/world/voxel_chunk.cpp @@ -821,7 +821,7 @@ void VoxelChunk::set_collider_transform(const int index, const Transform &transf } Ref VoxelChunk::get_collider_shape(const int index) { - ERR_FAIL_INDEX_V(index, _colliders.size(), Ref()); + ERR_FAIL_INDEX_V(index, _colliders.size(), Ref()); return _colliders[index].shape; } @@ -973,7 +973,10 @@ VoxelChunk::~VoxelChunk() { _library.unref(); } +#if PROPS_PRESENT clear_props(); +#endif + #if MESH_DATA_RESOURCE_PRESENT clear_mesh_data_resources(); #endif @@ -1297,11 +1300,13 @@ void VoxelChunk::_bind_methods() { //Meshes +#if PROPS_PRESENT ClassDB::bind_method(D_METHOD("add_prop", "prop"), &VoxelChunk::add_prop); ClassDB::bind_method(D_METHOD("get_prop", "index"), &VoxelChunk::get_prop); ClassDB::bind_method(D_METHOD("get_prop_count"), &VoxelChunk::get_prop_count); ClassDB::bind_method(D_METHOD("remove_prop", "index"), &VoxelChunk::remove_prop); ClassDB::bind_method(D_METHOD("clear_props"), &VoxelChunk::clear_props); +#endif #if MESH_DATA_RESOURCE_PRESENT ClassDB::bind_method(D_METHOD("add_mesh_data_resourcev", "local_data_pos", "mesh", "texture", "color", "apply_voxel_scale"), &VoxelChunk::add_mesh_data_resourcev, DEFVAL(Ref()), DEFVAL(Color(1, 1, 1, 1)), DEFVAL(true));