PathFollow2D and PathFollow3D: don't set offset to NaN
This commit is contained in:
parent
690fefe43e
commit
eb9157df23
2 changed files with 2 additions and 2 deletions
|
@ -311,7 +311,7 @@ void PathFollow2D::set_offset(real_t p_offset) {
|
|||
if (path->get_curve().is_valid()) {
|
||||
real_t path_length = path->get_curve()->get_baked_length();
|
||||
|
||||
if (loop) {
|
||||
if (loop && path_length) {
|
||||
offset = Math::fposmod(offset, path_length);
|
||||
if (!Math::is_zero_approx(p_offset) && Math::is_zero_approx(offset)) {
|
||||
offset = path_length;
|
||||
|
|
|
@ -310,7 +310,7 @@ void PathFollow3D::set_offset(real_t p_offset) {
|
|||
if (path->get_curve().is_valid()) {
|
||||
real_t path_length = path->get_curve()->get_baked_length();
|
||||
|
||||
if (loop) {
|
||||
if (loop && path_length) {
|
||||
offset = Math::fposmod(offset, path_length);
|
||||
if (!Math::is_zero_approx(p_offset) && Math::is_zero_approx(offset)) {
|
||||
offset = path_length;
|
||||
|
|
Loading…
Reference in a new issue