mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
Core/Hooks: Adds hooks for start and stop game events (#1472)
This commit is contained in:
committed by
Kargatum
parent
23d78ce6bc
commit
3a39aaeed5
@@ -18,6 +18,7 @@
|
||||
#include "UnitAI.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "Transport.h"
|
||||
#include "ScriptMgr.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
@@ -127,10 +128,10 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
#ifdef ELUNA
|
||||
|
||||
if (IsActiveEvent(event_id))
|
||||
sEluna->OnGameEventStart(event_id);
|
||||
#endif
|
||||
sScriptMgr->OnGameEventStart(event_id);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -153,10 +154,10 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
||||
// or to scedule another update where the next event will be started
|
||||
if (overwrite && conditions_met)
|
||||
sWorld->ForceGameEventUpdate();
|
||||
#ifdef ELUNA
|
||||
|
||||
if (IsActiveEvent(event_id))
|
||||
sEluna->OnGameEventStart(event_id);
|
||||
#endif
|
||||
sScriptMgr->OnGameEventStart(event_id);
|
||||
|
||||
return conditions_met;
|
||||
}
|
||||
}
|
||||
@@ -199,10 +200,9 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
}
|
||||
#ifdef ELUNA
|
||||
|
||||
if (!IsActiveEvent(event_id))
|
||||
sEluna->OnGameEventStop(event_id);
|
||||
#endif
|
||||
sScriptMgr->OnGameEventStop(event_id);
|
||||
}
|
||||
|
||||
void GameEventMgr::LoadFromDB()
|
||||
|
||||
Reference in New Issue
Block a user