From fe8c217b7cc85b1f35dc54eb342a8451828a7418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 27 Dec 2023 17:50:45 +0100 Subject: [PATCH] Fix warning in MSVC --- modules/lightmapper_rd/lightmapper_rd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index a4ecb767a7c..a1caaa27381 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -357,7 +357,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i for (int m_i = 0; m_i < mesh_instances.size(); m_i++) { if (p_step_function) { - float p = float(m_i + 1) / mesh_instances.size() * 0.1; + float p = float(m_i + 1) / MAX(1, mesh_instances.size()) * 0.1; p_step_function(0.3 + p, vformat(RTR("Plotting mesh into acceleration structure %d/%d"), m_i + 1, mesh_instances.size()), p_bake_userdata, false); }