diff options
Diffstat (limited to 'scene/2d/remote_transform_2d.cpp')
-rw-r--r-- | scene/2d/remote_transform_2d.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 53072f942d..ec50f5f922 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -33,7 +33,7 @@ void RemoteTransform2D::_update_cache() { - cache = 0; + cache = ObjectID(); if (has_node(remote_node)) { Node *node = get_node(remote_node); if (!node || this == node || node->is_a_parent_of(this) || this->is_a_parent_of(node)) { @@ -49,7 +49,7 @@ void RemoteTransform2D::_update_remote() { if (!is_inside_tree()) return; - if (!cache) + if (cache.is_null()) return; Node2D *n = Object::cast_to<Node2D>(ObjectDB::get_instance(cache)); @@ -119,7 +119,7 @@ void RemoteTransform2D::_notification(int p_what) { if (!is_inside_tree()) break; - if (cache) { + if (cache.is_valid()) { _update_remote(); } @@ -225,6 +225,5 @@ RemoteTransform2D::RemoteTransform2D() { update_remote_rotation = true; update_remote_scale = true; - cache = 0; set_notify_transform(true); } |