diff --git a/library/terrain_library.cpp b/library/terrain_library.cpp index fcb9324..9188b71 100644 --- a/library/terrain_library.cpp +++ b/library/terrain_library.cpp @@ -161,13 +161,13 @@ bool TerrainLibrary::_supports_caching() { //Materials Ref TerrainLibrary::material_get(const int index) { - ERR_FAIL_INDEX_V(index, _materials.size(), Ref(NULL)); + ERR_FAIL_INDEX_V(index, _materials.size(), Ref()); return _materials[index]; } Ref TerrainLibrary::material_lod_get(const int index) { - ERR_FAIL_COND_V(_materials.size() == 0, Ref(NULL)); + ERR_FAIL_COND_V_MSG(_materials.size() == 0, Ref(), "Error! You should to add at least one material to TerrainLibrary! (By default it will use up to 5. See VoxelWorldDefault::_create_chunk().)"); if (index < 0) { return _materials[0]; @@ -241,13 +241,13 @@ void TerrainLibrary::materials_set(const Vector &materials) { //Liquid Materials Ref TerrainLibrary::liquid_material_get(const int index) { - ERR_FAIL_INDEX_V(index, _liquid_materials.size(), Ref(NULL)); + ERR_FAIL_INDEX_V(index, _liquid_materials.size(), Ref()); return _liquid_materials[index]; } Ref TerrainLibrary::liquid_material_lod_get(const int index) { - ERR_FAIL_COND_V(_materials.size() == 0, Ref(NULL)); + ERR_FAIL_COND_V_MSG(_liquid_materials.size() == 0, Ref(), "Error! You should to add at least one liquid to TerrainLibrary! (By default it will use up to 5. See VoxelWorldDefault::_create_chunk().)"); if (index < 0) { return _liquid_materials[0]; @@ -321,13 +321,13 @@ void TerrainLibrary::liquid_materials_set(const Vector &materials) { //Prop Materials Ref TerrainLibrary::prop_material_get(const int index) { - ERR_FAIL_INDEX_V(index, _prop_materials.size(), Ref(NULL)); + ERR_FAIL_INDEX_V(index, _prop_materials.size(), Ref()); return _prop_materials[index]; } Ref TerrainLibrary::prop_material_lod_get(const int index) { - ERR_FAIL_COND_V(_prop_materials.size() == 0, Ref(NULL)); + ERR_FAIL_COND_V_MSG(_prop_materials.size() == 0, Ref(), "Error! You should to add at least one material to TerrainLibrary!"); if (index < 0) { return _prop_materials[0];