summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-18 09:36:02 +0200
committerGitHub <noreply@github.com>2022-07-18 09:36:02 +0200
commit73f47921eadf4c69e3c81d53d2ba095c588fe4c6 (patch)
tree38679c508b1c4578ddff10d006081ce9b30e4ccf /scene
parent168ee3e6c406dcb0c87454a05a9f2b863027ccaa (diff)
parentfded50fcedb073db08d0520bfde4f418aa7324f8 (diff)
Merge pull request #61590 from Haydoggo/path-follow-fix
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/path_2d.cpp1
-rw-r--r--scene/3d/path_3d.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp
index 8eb48ffb30..9862c4bfb1 100644
--- a/scene/2d/path_2d.cpp
+++ b/scene/2d/path_2d.cpp
@@ -304,6 +304,7 @@ void PathFollow2D::_bind_methods() {
}
void PathFollow2D::set_offset(real_t p_offset) {
+ ERR_FAIL_COND(!isfinite(p_offset));
offset = p_offset;
if (path) {
if (path->get_curve().is_valid()) {
diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp
index f53e783fbd..1f10337b4c 100644
--- a/scene/3d/path_3d.cpp
+++ b/scene/3d/path_3d.cpp
@@ -397,6 +397,7 @@ void PathFollow3D::_bind_methods() {
}
void PathFollow3D::set_offset(real_t p_offset) {
+ ERR_FAIL_COND(!isfinite(p_offset));
prev_offset = offset;
offset = p_offset;