Do not crash on empty path, closes #23701

This commit is contained in:
Juan Linietsky 2019-02-23 20:07:16 -03:00
parent d79c8d7655
commit 6cd4006fb3
1 changed files with 3 additions and 0 deletions

View File

@ -170,6 +170,9 @@ void PathFollow2D::_update_transform() {
return;
float path_length = c->get_baked_length();
if (path_length == 0) {
return;
}
float bounded_offset = offset;
if (loop)
bounded_offset = Math::fposmod(bounded_offset, path_length);