From f8cf6eb56730d2533c2797cb443779d489daf9f3 Mon Sep 17 00:00:00 2001 From: Ben Rog-Wilhelm Date: Wed, 2 Aug 2023 16:29:31 -0500 Subject: [PATCH] Fix NavMesh `map_update_id` returning 0 results in errors (cherry picked from commit d0564f2466cec9d0e108cadf18f2aae642c90be7) --- modules/navigation/nav_map.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 3a1d4126187..6d763245452 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -1043,7 +1043,8 @@ void NavMap::sync() { } // Update the update ID. - map_update_id = (map_update_id + 1) % 9999999; + // Some code treats 0 as a failure case, so we avoid returning 0. + map_update_id = map_update_id % 9999999 + 1; } // Do we have modified obstacle positions?