diff options
Diffstat (limited to 'scene/2d/path_2d.cpp')
-rw-r--r-- | scene/2d/path_2d.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index a79f60c96f..1d7bd8fc2a 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -3,7 +3,7 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ @@ -137,13 +137,8 @@ void PathFollow2D::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - Node *parent = get_parent(); - if (parent) { - - path = parent->cast_to<Path2D>(); - if (path) { - _update_transform(); - } + if ((path = Object::cast_to<Path2D>(get_parent()))) { + _update_transform(); } } break; @@ -231,7 +226,7 @@ String PathFollow2D::get_configuration_warning() const { if (!is_visible_in_tree() || !is_inside_tree()) return String(); - if (!get_parent() || !get_parent()->cast_to<Path2D>()) { + if (!Object::cast_to<Path2D>(get_parent())) { return TTR("PathFollow2D only works when set as a child of a Path2D node."); } |