Skip to content
Permalink
Browse files

ExpressionParser: Fix timer function with negative values.

  • Loading branch information...
jordan-woyak committed Jan 26, 2019
1 parent 18b5120 commit 08b291b0f9ca3edfd8603a32f2e62f658d012c4a
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/Core/InputCommon/ControlReference/FunctionExpression.cpp
@@ -114,9 +114,9 @@ class TimerExpression : public FunctionExpression

ControlState progress = std::chrono::duration_cast<FSec>(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;
}

0 comments on commit 08b291b

Please sign in to comment.
You can’t perform that action at this time.