From 0635a639e92577948ce61011ee31abedb35c05f6 Mon Sep 17 00:00:00 2001 From: Josh Grams Date: Tue, 8 Mar 2016 07:16:25 -0500 Subject: [PATCH] TimeScale node: return +inf remaining for 0 scale. (cherry picked from commit 65b7791263e8e20f83b6b7fbfd30329a0e4e9a4f) --- scene/animation/animation_tree_player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 18aac118f8c..9dcad8a533f 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -642,7 +642,10 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time,switched,true,p_filter,p_reverse_weight); else rem = _process_node(tsn->inputs[0].node,r_prev_anim,p_weight,p_time*tsn->scale,switched,false,p_filter,p_reverse_weight); - return rem / tsn->scale; + if (tsn->scale == 0) + return INFINITY; + else + return rem / tsn->scale; } break; case NODE_TIMESEEK: {