You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
prevent crash on NaN offset in path_follower 2d and 3d
This commit is contained in:
@@ -304,6 +304,7 @@ void PathFollow2D::_bind_methods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PathFollow2D::set_offset(real_t p_offset) {
|
void PathFollow2D::set_offset(real_t p_offset) {
|
||||||
|
ERR_FAIL_COND(!isfinite(p_offset));
|
||||||
offset = p_offset;
|
offset = p_offset;
|
||||||
if (path) {
|
if (path) {
|
||||||
if (path->get_curve().is_valid()) {
|
if (path->get_curve().is_valid()) {
|
||||||
|
|||||||
@@ -397,6 +397,7 @@ void PathFollow3D::_bind_methods() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PathFollow3D::set_offset(real_t p_offset) {
|
void PathFollow3D::set_offset(real_t p_offset) {
|
||||||
|
ERR_FAIL_COND(!isfinite(p_offset));
|
||||||
prev_offset = offset;
|
prev_offset = offset;
|
||||||
offset = p_offset;
|
offset = p_offset;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user