mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 20:56:23 +00:00
refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -37,7 +37,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
default:
|
||||
case GAMEEVENT_NORMAL:
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
// Get the event information
|
||||
return mGameEvent[entry].start < currenttime
|
||||
&& currenttime < mGameEvent[entry].end
|
||||
@@ -54,7 +54,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
// if inactive world event, check the prerequisite events
|
||||
case GAMEEVENT_WORLD_INACTIVE:
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
for (std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
||||
{
|
||||
if ((mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) || // if prereq not in nextphase or finished state, then can't start this one
|
||||
@@ -70,7 +70,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
|
||||
uint32 GameEventMgr::NextCheck(uint16 entry) const
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
|
||||
// for NEXTPHASE state world events, return the delay to start the next event, so the followup event will be checked correctly
|
||||
if ((mGameEvent[entry].state == GAMEEVENT_WORLD_NEXTPHASE || mGameEvent[entry].state == GAMEEVENT_WORLD_FINISHED) && mGameEvent[entry].nextstart >= currenttime)
|
||||
@@ -130,7 +130,7 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
||||
ApplyNewEvent(event_id);
|
||||
if (overwrite)
|
||||
{
|
||||
mGameEvent[event_id].start = time(NULL);
|
||||
mGameEvent[event_id].start = time(nullptr);
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
@@ -178,7 +178,7 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
||||
|
||||
if (overwrite && !serverwide_evt)
|
||||
{
|
||||
data.start = time(NULL) - data.length * MINUTE;
|
||||
data.start = time(nullptr) - data.length * MINUTE;
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ void GameEventMgr::LoadFromDB()
|
||||
newEntry.entry = data->id;
|
||||
|
||||
// check validity with event's npcflag
|
||||
if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag))
|
||||
if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, nullptr, nullptr, event_npc_flag))
|
||||
continue;
|
||||
|
||||
vendors.push_back(newEntry);
|
||||
@@ -1100,7 +1100,7 @@ void GameEventMgr::StartArenaSeason()
|
||||
|
||||
uint32 GameEventMgr::Update() // return the next event delay in ms
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
uint32 nextEventDelay = max_ge_check_delay; // 1 day
|
||||
uint32 calcDelay;
|
||||
std::set<uint16> activate, deactivate;
|
||||
@@ -1682,7 +1682,7 @@ bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
|
||||
// set the followup events' start time
|
||||
if (!mGameEvent[event_id].nextstart)
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
time_t currenttime = time(nullptr);
|
||||
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
||||
}
|
||||
return true;
|
||||
@@ -1779,7 +1779,7 @@ void GameEventMgr::SetHolidayEventTime(GameEventData& event)
|
||||
|
||||
bool singleDate = ((holiday->Date[0] >> 24) & 0x1F) == 31; // Events with fixed date within year have - 1
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
for (int i = 0; i < MAX_HOLIDAY_DATES && holiday->Date[i]; ++i)
|
||||
{
|
||||
uint32 date = holiday->Date[i];
|
||||
|
||||
Reference in New Issue
Block a user