Temporary revert 6743 commit. I fix this patch across 1-2 days.
--HG-- branch : trunk
This commit is contained in:
1 parent
acdc4ca15b
commit
250a00cc1c
53 files changed
+365
-354
No files matched your search
@@ -30,7 +30,6 @@
|
||||
#include "GossipDef.h"
|
||||
#include "Player.h"
|
||||
#include "BattleGroundMgr.h"
|
||||
#include "TimeMgr.h"
|
||||
|
||||
INSTANTIATE_SINGLETON_1(GameEventMgr);
|
||||
|
||||
@@ -41,7 +40,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
default:
|
||||
case GAMEEVENT_NORMAL:
|
||||
{
|
||||
time_t currenttime = sGameTime.GetGameTime();
|
||||
time_t currenttime = time(NULL);
|
||||
// Get the event information
|
||||
return mGameEvent[entry].start < currenttime
|
||||
&& currenttime < mGameEvent[entry].end
|
||||
@@ -58,7 +57,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
// if inactive world event, check the prerequisite events
|
||||
case GAMEEVENT_WORLD_INACTIVE:
|
||||
{
|
||||
time_t currenttime = sGameTime.GetGameTime();
|
||||
time_t currenttime = time(NULL);
|
||||
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
|
||||
@@ -74,7 +73,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
|
||||
uint32 GameEventMgr::NextCheck(uint16 entry) const
|
||||
{
|
||||
time_t currenttime = sGameTime.GetGameTime();
|
||||
time_t currenttime = time(NULL);
|
||||
|
||||
// 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)
|
||||
@@ -129,7 +128,7 @@ bool GameEventMgr::StartEvent( uint16 event_id, bool overwrite )
|
||||
ApplyNewEvent(event_id);
|
||||
if(overwrite)
|
||||
{
|
||||
mGameEvent[event_id].start = sGameTime.GetGameTime();
|
||||
mGameEvent[event_id].start = time(NULL);
|
||||
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||
}
|
||||
@@ -169,7 +168,7 @@ void GameEventMgr::StopEvent( uint16 event_id, bool overwrite )
|
||||
|
||||
if(overwrite && !serverwide_evt)
|
||||
{
|
||||
mGameEvent[event_id].start = sGameTime.GetGameTime() - mGameEvent[event_id].length * MINUTE;
|
||||
mGameEvent[event_id].start = time(NULL) - mGameEvent[event_id].length * MINUTE;
|
||||
if(mGameEvent[event_id].end <= mGameEvent[event_id].start)
|
||||
mGameEvent[event_id].end = mGameEvent[event_id].start+mGameEvent[event_id].length;
|
||||
}
|
||||
@@ -1046,7 +1045,7 @@ uint32 GameEventMgr::Initialize() // return the next e
|
||||
|
||||
uint32 GameEventMgr::Update() // return the next event delay in ms
|
||||
{
|
||||
time_t currenttime = sGameTime.GetGameTime();
|
||||
time_t currenttime = time(NULL);
|
||||
uint32 nextEventDelay = max_ge_check_delay; // 1 day
|
||||
uint32 calcDelay;
|
||||
std::set<uint16> activate, deactivate;
|
||||
@@ -1599,7 +1598,7 @@ bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
|
||||
// set the followup events' start time
|
||||
if(!mGameEvent[event_id].nextstart)
|
||||
{
|
||||
time_t currenttime = sGameTime.GetGameTime();
|
||||
time_t currenttime = time(NULL);
|
||||
mGameEvent[event_id].nextstart = currenttime + mGameEvent[event_id].length * 60;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user