TimeOfDay does not need to be an Int64
This commit is contained in:
parent
4bdf9256f2
commit
2c945c8818
@ -17,7 +17,7 @@ class cWorldInterface
|
|||||||
public:
|
public:
|
||||||
virtual ~cWorldInterface() {}
|
virtual ~cWorldInterface() {}
|
||||||
|
|
||||||
virtual Int64 GetTimeOfDay(void) const = 0;
|
virtual int GetTimeOfDay(void) const = 0;
|
||||||
virtual Int64 GetWorldAge(void) const = 0;
|
virtual Int64 GetWorldAge(void) const = 0;
|
||||||
|
|
||||||
virtual eDimension GetDimension(void) const = 0;
|
virtual eDimension GetDimension(void) const = 0;
|
||||||
@ -44,7 +44,7 @@ public:
|
|||||||
/** Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true */
|
/** Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true */
|
||||||
virtual bool ForEachPlayer(cItemCallback<cPlayer> & a_Callback) = 0;
|
virtual bool ForEachPlayer(cItemCallback<cPlayer> & a_Callback) = 0;
|
||||||
|
|
||||||
virtual void SetTimeOfDay(Int64 a_TimeOfDay) = 0;
|
virtual void SetTimeOfDay(int a_TimeOfDay) = 0;
|
||||||
|
|
||||||
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
|
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
|
||||||
virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) = 0;
|
virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) = 0;
|
||||||
|
@ -876,7 +876,7 @@ void cWorld::Tick(float a_Dt, int a_LastTickDurationMSec)
|
|||||||
m_TimeOfDaySecs -= 1200.0;
|
m_TimeOfDaySecs -= 1200.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_TimeOfDay = (Int64)(m_TimeOfDaySecs * 20.0);
|
m_TimeOfDay = static_cast<int>(m_TimeOfDaySecs * 20.0);
|
||||||
|
|
||||||
// Updates the sky darkness based on current time of day
|
// Updates the sky darkness based on current time of day
|
||||||
UpdateSkyDarkness();
|
UpdateSkyDarkness();
|
||||||
|
@ -157,14 +157,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual Int64 GetWorldAge (void) const override { return m_WorldAge; }
|
virtual Int64 GetWorldAge (void) const override { return m_WorldAge; }
|
||||||
virtual Int64 GetTimeOfDay(void) const override { return m_TimeOfDay; }
|
virtual int GetTimeOfDay(void) const override { return m_TimeOfDay; }
|
||||||
|
|
||||||
void SetTicksUntilWeatherChange(int a_WeatherInterval)
|
void SetTicksUntilWeatherChange(int a_WeatherInterval)
|
||||||
{
|
{
|
||||||
m_WeatherInterval = a_WeatherInterval;
|
m_WeatherInterval = a_WeatherInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void SetTimeOfDay(Int64 a_TimeOfDay) override
|
virtual void SetTimeOfDay(int a_TimeOfDay) override
|
||||||
{
|
{
|
||||||
m_TimeOfDay = a_TimeOfDay;
|
m_TimeOfDay = a_TimeOfDay;
|
||||||
m_TimeOfDaySecs = (double)a_TimeOfDay / 20.0;
|
m_TimeOfDaySecs = (double)a_TimeOfDay / 20.0;
|
||||||
@ -888,7 +888,7 @@ private:
|
|||||||
double m_WorldAgeSecs; // World age, in seconds. Is only incremented, cannot be set by plugins.
|
double m_WorldAgeSecs; // World age, in seconds. Is only incremented, cannot be set by plugins.
|
||||||
double m_TimeOfDaySecs; // Time of day in seconds. Can be adjusted. Is wrapped to zero each day.
|
double m_TimeOfDaySecs; // Time of day in seconds. Can be adjusted. Is wrapped to zero each day.
|
||||||
Int64 m_WorldAge; // World age in ticks, calculated off of m_WorldAgeSecs
|
Int64 m_WorldAge; // World age in ticks, calculated off of m_WorldAgeSecs
|
||||||
Int64 m_TimeOfDay; // Time in ticks, calculated off of m_TimeOfDaySecs
|
int m_TimeOfDay; // Time in ticks, calculated off of m_TimeOfDaySecs
|
||||||
Int64 m_LastTimeUpdate; // The tick in which the last time update has been sent.
|
Int64 m_LastTimeUpdate; // The tick in which the last time update has been sent.
|
||||||
Int64 m_LastUnload; // The last WorldAge (in ticks) in which unloading was triggerred
|
Int64 m_LastUnload; // The last WorldAge (in ticks) in which unloading was triggerred
|
||||||
Int64 m_LastSave; // The last WorldAge (in ticks) in which save-all was triggerred
|
Int64 m_LastSave; // The last WorldAge (in ticks) in which save-all was triggerred
|
||||||
|
Loading…
Reference in New Issue
Block a user