From 08b291b0f9ca3edfd8603a32f2e62f658d012c4a Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Sat, 26 Jan 2019 14:48:26 -0600 Subject: [PATCH] ExpressionParser: Fix timer function with negative values. --- .../Core/InputCommon/ControlReference/FunctionExpression.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/InputCommon/ControlReference/FunctionExpression.cpp b/Source/Core/InputCommon/ControlReference/FunctionExpression.cpp index 9e6607bce4..d233519b34 100644 --- a/Source/Core/InputCommon/ControlReference/FunctionExpression.cpp +++ b/Source/Core/InputCommon/ControlReference/FunctionExpression.cpp @@ -114,9 +114,9 @@ private: ControlState progress = std::chrono::duration_cast(elapsed).count() / val; - if (std::isinf(progress)) + if (std::isinf(progress) || progress < 0.0) { - // User configured a 0.0 length timer. Reset the timer and return 0.0. + // User configured a non-positive timer. Reset the timer and return 0.0. progress = 0.0; m_start_time = now; }