mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
feat(Core/Common): add new helpers for time utility (#10207)
This commit is contained in:
@@ -20,12 +20,12 @@
|
||||
*/
|
||||
|
||||
#include "Weather.h"
|
||||
#include "MiscPackets.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "MiscPackets.h"
|
||||
|
||||
/// Create the Weather object
|
||||
Weather::Weather(uint32 zone, WeatherData const* weatherChances)
|
||||
@@ -89,10 +89,7 @@ bool Weather::ReGenerate()
|
||||
|
||||
//78 days between January 1st and March 20nd; 365/4=91 days by season
|
||||
// season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html
|
||||
time_t gtime = sWorld->GetGameTime();
|
||||
struct tm ltime;
|
||||
localtime_r(>ime, <ime);
|
||||
uint32 season = ((ltime.tm_yday - 78 + 365) / 91) % 4;
|
||||
uint32 season = ((Acore::Time::GetDayInYear() - 78 + 365) / 91) % 4;
|
||||
|
||||
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
|
||||
LOG_DEBUG("weather", "Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
|
||||
|
||||
Reference in New Issue
Block a user