From d0fd5fd3c787210fa584e4a933280bd82daaec02 Mon Sep 17 00:00:00 2001 From: jfons Date: Thu, 24 Feb 2022 13:00:51 +0100 Subject: Add sanity checks to lightmap unwrap texel size --- scene/resources/mesh.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/resources') diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 441e84eccc..6b44b05e02 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1684,6 +1684,7 @@ Error ArrayMesh::lightmap_unwrap(const Transform3D &p_base_transform, float p_te Error ArrayMesh::lightmap_unwrap_cached(const Transform3D &p_base_transform, float p_texel_size, const Vector &p_src_cache, Vector &r_dst_cache, bool p_generate_cache) { ERR_FAIL_COND_V(!array_mesh_lightmap_unwrap_callback, ERR_UNCONFIGURED); ERR_FAIL_COND_V_MSG(blend_shapes.size() != 0, ERR_UNAVAILABLE, "Can't unwrap mesh with blend shapes."); + ERR_FAIL_COND_V_MSG(p_texel_size <= 0.0f, ERR_PARAMETER_RANGE_ERROR, "Texel size must be greater than 0."); LocalVector vertices; LocalVector normals; -- cgit v1.2.3