summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-02-24 13:29:51 +0100
committerGitHub <noreply@github.com>2022-02-24 13:29:51 +0100
commit4dc8214831d1617e7f5f06e8294fb37ea23dae59 (patch)
treeb6290bee460d62ccab9ed996748d362d7abec792 /scene
parent093b46ddf002683ef2e8144fd14265026ef52d21 (diff)
parentd0fd5fd3c787210fa584e4a933280bd82daaec02 (diff)
Merge pull request #58496 from JFonS/fix_lm_crash
Diffstat (limited to 'scene')
-rw-r--r--scene/resources/mesh.cpp1
1 files changed, 1 insertions, 0 deletions
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<uint8_t> &p_src_cache, Vector<uint8_t> &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<float> vertices;
LocalVector<float> normals;