mirror of
https://github.com/godotengine/godot.git
synced 2024-11-14 08:03:05 +00:00
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;
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user