aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp5
-rw-r--r--src/server/game/Spells/SpellInfo.cpp5
-rw-r--r--src/server/game/Weather/Weather.cpp5
-rw-r--r--src/server/game/World/World.cpp16
4 files changed, 21 insertions, 10 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 7f1d231ebd9..2f309c07cce 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -5236,9 +5236,10 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
uint32 oldMSTime = getMSTime();
time_t curTime = time(NULL);
- tm* lt = localtime(&curTime);
+ tm lt;
+ ACE_OS::localtime_r(&curTime, &lt);
uint64 basetime(curTime);
- TC_LOG_INFO(LOG_FILTER_GENERAL, "Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec);
+ TC_LOG_INFO(LOG_FILTER_GENERAL, "Returning mails current time: hour: %d, minute: %d, second: %d ", lt.tm_hour, lt.tm_min, lt.tm_sec);
// Delete all old mails without item and without body immediately, if starting server
if (!serverUp)
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 99242d622df..a0e1ec065cc 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1026,8 +1026,11 @@ bool SpellInfo::NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) con
uint32 mask = 0;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER && Effects[i].TargetA.GetTarget() != TARGET_DEST_CASTER)
+ if (Effects[i].TargetA.GetTarget() != TARGET_UNIT_CASTER && Effects[i].TargetA.GetTarget() != TARGET_DEST_CASTER
+ && Effects[i].TargetB.GetTarget() != TARGET_UNIT_CASTER && Effects[i].TargetB.GetTarget() != TARGET_DEST_CASTER)
+ {
mask |= Effects[i].GetProvidedTargetMask();
+ }
}
if (mask & TARGET_FLAG_UNIT_MASK)
diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp
index 38d64eedd5c..0457dc7e033 100644
--- a/src/server/game/Weather/Weather.cpp
+++ b/src/server/game/Weather/Weather.cpp
@@ -93,8 +93,9 @@ 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(&gtime);
- uint32 season = ((ltime->tm_yday - 78 + 365)/91)%4;
+ struct tm ltime;
+ ACE_OS::localtime_r(&gtime, &ltime);
+ uint32 season = ((ltime.tm_yday - 78 + 365)/91)%4;
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index b1dc05e8d63..bfc512bc9a6 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1738,7 +1738,9 @@ void World::SetInitialWorldSettings()
//mailtimer is increased when updating auctions
//one second is 1000 -(tested on win system)
/// @todo Get rid of magic numbers
- mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
+ tm localTm;
+ ACE_OS::localtime_r(&m_gameTime, &localTm);
+ mail_timer = ((((localTm.tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
//1440
mail_timer_expires = ((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, "Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires));
@@ -2777,7 +2779,8 @@ void World::InitDailyQuestResetTime()
// client built-in time for reset is 6:00 AM
// FIX ME: client not show day start time
time_t curTime = time(NULL);
- tm localTm = *localtime(&curTime);
+ tm localTm;
+ ACE_OS::localtime_r(&curTime, &localTm);
localTm.tm_hour = 6;
localTm.tm_min = 0;
localTm.tm_sec = 0;
@@ -2810,7 +2813,8 @@ void World::InitRandomBGResetTime()
// generate time by config
time_t curTime = time(NULL);
- tm localTm = *localtime(&curTime);
+ tm localTm;
+ ACE_OS::localtime_r(&curTime, &localTm);
localTm.tm_hour = getIntConfig(CONFIG_RANDOM_BG_RESET_HOUR);
localTm.tm_min = 0;
localTm.tm_sec = 0;
@@ -2837,7 +2841,8 @@ void World::InitGuildResetTime()
// generate time by config
time_t curTime = time(NULL);
- tm localTm = *localtime(&curTime);
+ tm localTm;
+ ACE_OS::localtime_r(&curTime, &localTm);
localTm.tm_hour = getIntConfig(CONFIG_GUILD_RESET_HOUR);
localTm.tm_min = 0;
localTm.tm_sec = 0;
@@ -2921,7 +2926,8 @@ void World::ResetMonthlyQuests()
// generate time
time_t curTime = time(NULL);
- tm localTm = *localtime(&curTime);
+ tm localTm;
+ ACE_OS::localtime_r(&curTime, &localTm);
int month = localTm.tm_mon;
int year = localTm.tm_year;