diff --git a/lib/base/scriptutils.cpp b/lib/base/scriptutils.cpp index 085c7260c..4d62522d9 100644 --- a/lib/base/scriptutils.cpp +++ b/lib/base/scriptutils.cpp @@ -227,9 +227,8 @@ Array::Ptr ScriptUtils::Range(const std::vector& arguments) (start > end && increment >= 0)) return result; - for (double i = start; i < end; i += increment) { + for (double i = start; (increment > 0 ? i < end : i > end); i += increment) result->Add(i); - } return result; }