diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-08-03 22:37:49 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-08-03 22:37:49 +0200 |
commit | eb4301b941fa211de204e37bd4d701f7e490a945 (patch) | |
tree | 8a8e3d7575bf043769aecf4356762b264c0f8bbb | |
parent | 1610fc2ae78776fbeed8f5eb16781e66c372f051 (diff) | |
parent | d0564f2466cec9d0e108cadf18f2aae642c90be7 (diff) | |
download | redot-engine-eb4301b941fa211de204e37bd4d701f7e490a945.tar.gz |
Merge pull request #80189 from zorbathut/pr_zeroupdateid
Fix NavMesh `map_update_id` returning 0 results in errors.
-rw-r--r-- | modules/navigation/nav_map.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 8b7274d673..737ccaf3cd 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -1060,7 +1060,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? |