From ab14a96bd57493f81bb77a2371cecff8a36e9985 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 30 Jan 2016 16:23:28 +0100 Subject: [PATCH] Merge with develop --- .../game_share/time_weather_season/time_and_season.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h index bf08129e8..92892fd85 100644 --- a/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h +++ b/code/ryzom/common/src/game_share/time_weather_season/time_and_season.h @@ -134,21 +134,20 @@ public: CRyzomTime() { _RyzomDay = 0; - _RyzomTime = 0; + _RyzomTime = 0.f; + _LocalTime = 0.0; _TickOffset = 0; - _RyzomTime = 0; } // Update ryzom clock when tick occurs, local time must be given if localUpdateRyzomClock() and getLocalRyzomTime() is used void updateRyzomClock( uint32 gameCyle, double localTime = 0 ) { - float time = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS); - _RyzomDay = (uint32) ( time / 24.0f ) - RYZOM_START_SPRING; - _RyzomTime = (float) fmod( time, 24.0f ); + float hours = ( gameCyle + _TickOffset ) / float(RYZOM_HOURS_IN_TICKS); + _RyzomDay = ( (uint)hours / RYZOM_DAY_IN_HOUR ) - RYZOM_START_SPRING; + _RyzomTime = (float) fmod( hours, (float)RYZOM_DAY_IN_HOUR ); _LocalTime = localTime; } - // get ryzom time (synchronized with server) inline float getRyzomTime() const { return _RyzomTime; }