mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
Support negative days in TimeStamp
As vanilla engine does.
This commit is contained in:
parent
45e673564f
commit
013f56088b
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <components/esm/defs.hpp>
|
#include <components/esm/defs.hpp>
|
||||||
|
|
||||||
@ -11,8 +12,8 @@ namespace MWWorld
|
|||||||
: mHour(hour)
|
: mHour(hour)
|
||||||
, mDay(day)
|
, mDay(day)
|
||||||
{
|
{
|
||||||
if (hour < 0 || hour >= 24 || day < 0)
|
if (hour < 0 || hour >= 24)
|
||||||
throw std::runtime_error("invalid time stamp");
|
throw std::runtime_error("invalid time stamp hour: " + std::to_string(hour));
|
||||||
}
|
}
|
||||||
|
|
||||||
float TimeStamp::getHour() const
|
float TimeStamp::getHour() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user