From 013f56088bec7cd9871abeac0a7a1e2d64489c67 Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 1 Nov 2022 22:12:25 +0100 Subject: [PATCH] Support negative days in TimeStamp As vanilla engine does. --- apps/openmw/mwworld/timestamp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/timestamp.cpp b/apps/openmw/mwworld/timestamp.cpp index 3ffb384967..22fa504d45 100644 --- a/apps/openmw/mwworld/timestamp.cpp +++ b/apps/openmw/mwworld/timestamp.cpp @@ -2,6 +2,7 @@ #include #include +#include #include @@ -11,8 +12,8 @@ namespace MWWorld : mHour(hour) , mDay(day) { - if (hour < 0 || hour >= 24 || day < 0) - throw std::runtime_error("invalid time stamp"); + if (hour < 0 || hour >= 24) + throw std::runtime_error("invalid time stamp hour: " + std::to_string(hour)); } float TimeStamp::getHour() const