diff options
Diffstat (limited to 'scene/animation/animation_cache.cpp')
| -rw-r--r-- | scene/animation/animation_cache.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 6c67af5777..84b3f103c5 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -133,19 +133,19 @@ void AnimationCache::_update_cache() {  		} else {  			if (np.get_subname_count() > 0) { -				RES res; +				RES res2;  				Vector<StringName> leftover_subpath;  				// We don't want to cache the last resource unless it is a method call  				bool is_method = animation->track_get_type(i) == Animation::TYPE_METHOD; -				root->get_node_and_resource(np, res, leftover_subpath, is_method); +				root->get_node_and_resource(np, res2, leftover_subpath, is_method); -				if (res.is_valid()) { -					path.resource = res; +				if (res2.is_valid()) { +					path.resource = res2;  				} else {  					path.node = node;  				} -				path.object = res.is_valid() ? res.ptr() : (Object *)node; +				path.object = res2.is_valid() ? res2.ptr() : (Object *)node;  				path.subpath = leftover_subpath;  			} else { @@ -309,7 +309,8 @@ void AnimationCache::set_all(float p_time, float p_delta) {  				}  			} break; -			default: {} +			default: { +			}  		}  	}  }  |