Backported from godot4: Fix NavMesh map_update_id returning 0 results in errors

- zorbathut
d0564f2466
This commit is contained in:
Relintai 2023-09-04 17:56:34 +02:00
parent 493af67f7a
commit dcd93ef8ba

View File

@ -1079,7 +1079,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?