1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 21:45:35 +00:00

Merge branch 'time_stamp_48' into 'openmw-48'

Support negative days in TimeStamp for 0.48 (#6981)

See merge request OpenMW/openmw!2493
This commit is contained in:
psi29a 2022-11-02 21:51:39 +00:00
commit 2580cbfe67

View file

@ -2,6 +2,7 @@
#include <cmath>
#include <stdexcept>
#include <string>
#include <components/esm/defs.hpp>
@ -10,8 +11,8 @@ namespace MWWorld
TimeStamp::TimeStamp (float hour, int day)
: 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