1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-22 23:39:42 +00:00

Merge branch 'time_stamp' into 'master'

Support negative days in TimeStamp (#6981)

Closes #6981

See merge request OpenMW/openmw!2492
This commit is contained in:
psi29a 2022-11-02 08:18:33 +00:00
commit 824f3b8c19

View file

@ -2,6 +2,7 @@
#include <cmath>
#include <stdexcept>
#include <string>
#include <components/esm/defs.hpp>
@ -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