Do not crash on empty path, closes #23701
This commit is contained in:
parent
d79c8d7655
commit
6cd4006fb3
|
@ -170,6 +170,9 @@ void PathFollow2D::_update_transform() {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float path_length = c->get_baked_length();
|
float path_length = c->get_baked_length();
|
||||||
|
if (path_length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
float bounded_offset = offset;
|
float bounded_offset = offset;
|
||||||
if (loop)
|
if (loop)
|
||||||
bounded_offset = Math::fposmod(bounded_offset, path_length);
|
bounded_offset = Math::fposmod(bounded_offset, path_length);
|
||||||
|
|
Loading…
Reference in New Issue