mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 09:06:19 +00:00
Changed: Minor changes (thanks to SIELA1915)
--HG-- branch : develop
This commit is contained in:
parent
178c1acc3b
commit
75307d00da
1 changed files with 5 additions and 6 deletions
|
@ -134,21 +134,20 @@ public:
|
||||||
CRyzomTime()
|
CRyzomTime()
|
||||||
{
|
{
|
||||||
_RyzomDay = 0;
|
_RyzomDay = 0;
|
||||||
_RyzomTime = 0;
|
_RyzomTime = 0.f;
|
||||||
|
_LocalTime = 0.0;
|
||||||
_TickOffset = 0;
|
_TickOffset = 0;
|
||||||
_RyzomTime = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used
|
// Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used
|
||||||
void updateRyzomClock( uint32 gameCyle, double localTime = 0 )
|
void updateRyzomClock( uint32 gameCyle, double localTime = 0 )
|
||||||
{
|
{
|
||||||
float time = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
float hours = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS);
|
||||||
_RyzomDay = (uint32) ( time / 24.0f ) - RYZOM_START_SPRING;
|
_RyzomDay = ( (uint)hours / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING;
|
||||||
_RyzomTime = (float) fmod( time, 24.0f );
|
_RyzomTime = (float) fmod( hours, (float)RYZOM_DAY_IN_HOUR );
|
||||||
_LocalTime = localTime;
|
_LocalTime = localTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get ryzom time (synchronized with server)
|
// get ryzom time (synchronized with server)
|
||||||
inline float getRyzomTime() const { return _RyzomTime; }
|
inline float getRyzomTime() const { return _RyzomTime; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue