From b26c479002263162407c707ef4752850915b25b3 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sat, 13 Jun 2020 18:24:27 +0200 Subject: [PATCH] prevent negative times --- ScStwLibraries/sources/scstwtimer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ScStwLibraries/sources/scstwtimer.cpp b/ScStwLibraries/sources/scstwtimer.cpp index 0adf62d..11950e5 100644 --- a/ScStwLibraries/sources/scstwtimer.cpp +++ b/ScStwLibraries/sources/scstwtimer.cpp @@ -222,7 +222,7 @@ double ScStwTimer::getCurrentTime() { return QDateTime::currentMSecsSinceEpoch() - this->startTime; default: { if(this->state == WAITING || this->state == WON || this->state == LOST) - return this->stopTime - this->startTime; + return abs(this->stopTime - this->startTime); else return -1; }