summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-12-12 11:00:06 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-12-12 11:00:06 +0100
commit84692c6252438393999c427bf7f5d35b9c43926c (patch)
treedd0f32ca67c7e6a233c7387426caad46db2b2c14
parent63f3de3aadf9af862227815e8c82a8e6fdbde50c (diff)
downloadredot-engine-84692c6252438393999c427bf7f5d35b9c43926c.tar.gz
Navigation: Fix GCC 12.3 `-Wtype-limits` warnings
-rw-r--r--modules/navigation/nav_map.cpp2
-rw-r--r--modules/navigation/nav_region.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp
index 2add9f5ef5..3b875b7fa7 100644
--- a/modules/navigation/nav_map.cpp
+++ b/modules/navigation/nav_map.cpp
@@ -816,7 +816,7 @@ Vector3 NavMap::get_random_point(uint32_t p_navigation_layers, bool p_uniformly)
RBMap<real_t, uint32_t>::Iterator E = accessible_regions_area_map.find_closest(random_accessible_regions_area_map);
ERR_FAIL_COND_V(!E, Vector3());
uint32_t random_region_index = E->value;
- ERR_FAIL_INDEX_V(random_region_index, accessible_regions.size(), Vector3());
+ ERR_FAIL_UNSIGNED_INDEX_V(random_region_index, accessible_regions.size(), Vector3());
const NavRegion *random_region = accessible_regions[random_region_index];
ERR_FAIL_NULL_V(random_region, Vector3());
diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp
index 11b7759358..9cb235d79f 100644
--- a/modules/navigation/nav_region.cpp
+++ b/modules/navigation/nav_region.cpp
@@ -135,7 +135,7 @@ Vector3 NavRegion::get_random_point(uint32_t p_navigation_layers, bool p_uniform
RBMap<real_t, uint32_t>::Iterator region_E = region_area_map.find_closest(region_area_map_pos);
ERR_FAIL_COND_V(!region_E, Vector3());
uint32_t rrp_polygon_index = region_E->value;
- ERR_FAIL_INDEX_V(rrp_polygon_index, region_polygons.size(), Vector3());
+ ERR_FAIL_UNSIGNED_INDEX_V(rrp_polygon_index, region_polygons.size(), Vector3());
const gd::Polygon &rr_polygon = region_polygons[rrp_polygon_index];
@@ -161,7 +161,7 @@ Vector3 NavRegion::get_random_point(uint32_t p_navigation_layers, bool p_uniform
RBMap<real_t, uint32_t>::Iterator polygon_E = polygon_area_map.find_closest(polygon_area_map_pos);
ERR_FAIL_COND_V(!polygon_E, Vector3());
uint32_t rrp_face_index = polygon_E->value;
- ERR_FAIL_INDEX_V(rrp_face_index, rr_polygon.points.size(), Vector3());
+ ERR_FAIL_UNSIGNED_INDEX_V(rrp_face_index, rr_polygon.points.size(), Vector3());
const Face3 face(rr_polygon.points[0].pos, rr_polygon.points[rrp_face_index - 1].pos, rr_polygon.points[rrp_face_index].pos);