Merge pull request #6218 from terra-nova/issue-5277

Fix issue #5277
This commit is contained in:
Jean Flach 2018-04-12 14:50:11 +02:00 committed by GitHub
commit 0e8971b48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -158,16 +158,15 @@ bool Downtime::IsInEffect() const
{
double now = Utility::GetTime();
if (now < GetStartTime() ||
now > GetEndTime())
return false;
if (GetFixed())
return true;
if (GetFixed()) {
/* fixed downtimes are in effect during the entire [start..end) interval */
return (now >= GetStartTime() && now < GetEndTime());
}
double triggerTime = GetTriggerTime();
if (triggerTime == 0)
/* flexible downtime has not been triggered yet */
return false;
return (now < triggerTime + GetDuration());