summaryrefslogtreecommitdiff
path: root/servers/visual/visual_server_raster.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/visual/visual_server_raster.cpp')
-rw-r--r--servers/visual/visual_server_raster.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp
index c9695b7859..2ce0c9a360 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -5667,7 +5667,10 @@ void VisualServerRaster::_instance_validate_autorooms(Instance *p_geometry) {
int pass = room->room_info->room->bounds.get_points_inside(dst_points,point_count);
- float ratio = (float)pass / point_count;
+ float ratio = pass;
+ if( point_count != 0 ) {
+ ratio /= (float)point_count;
+ }
if (ratio>0.5) // should make some constant
p_geometry->valid_auto_rooms.insert(room);
@@ -7670,5 +7673,3 @@ VisualServerRaster::VisualServerRaster(Rasterizer *p_rasterizer) {
VisualServerRaster::~VisualServerRaster()
{
}
-
-