mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
Eluna implementation (#847)
* azerothcore + eluna done. * Remove the Eluna single thread limit. * Read Eluna Settings file. * submodule change. * fix(test) Ubuntu - Cant Link Library after Compile * The ELUNA is disabled by default. * remove submodule luaEngine. * some change * fix a error * change cmake * fix: some onplayerchat does not have hooks. * Eluna: Add BG event Hooks. * fix:cmake hook AFTER_LOAD_CONF not work. * Remove the eluna switch. * Remove some define in the core. * fix conf file not read in the linux. * eluna : change bg hook parameter type * Remove TC log function call * change bg hook OnBGEnd parameter type. Note: to enable Eluna, the module is required
This commit is contained in:
@@ -41,6 +41,11 @@
|
||||
#include "Chat.h"
|
||||
#include "DynamicVisibility.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#include "ElunaEventMgr.h"
|
||||
#endif
|
||||
|
||||
uint32 GuidHigh2TypeId(uint32 guid_hi)
|
||||
{
|
||||
switch (guid_hi)
|
||||
@@ -78,6 +83,11 @@ Object::Object() : m_PackGUID(sizeof(uint64)+1)
|
||||
|
||||
WorldObject::~WorldObject()
|
||||
{
|
||||
#ifdef ELUNA
|
||||
delete elunaEvents;
|
||||
elunaEvents = NULL;
|
||||
#endif
|
||||
|
||||
// this may happen because there are many !create/delete
|
||||
if (IsWorldObject() && m_currMap)
|
||||
{
|
||||
@@ -957,6 +967,9 @@ void MovementInfo::OutDebug()
|
||||
}
|
||||
|
||||
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), LastUsedScriptID(0),
|
||||
#ifdef ELUNA
|
||||
elunaEvents(NULL),
|
||||
#endif
|
||||
m_name(""), m_isActive(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
|
||||
m_transport(NULL), m_currMap(NULL), m_InstanceId(0),
|
||||
m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0), m_executed_notifies(0)
|
||||
@@ -965,6 +978,13 @@ m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0), m_executed_notifies(0)
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
void WorldObject::Update(uint32 time_diff)
|
||||
{
|
||||
elunaEvents->Update(time_diff);
|
||||
}
|
||||
#endif
|
||||
|
||||
void WorldObject::SetWorldObject(bool on)
|
||||
{
|
||||
if (!IsInWorld())
|
||||
@@ -1990,6 +2010,13 @@ void WorldObject::SetMap(Map* map)
|
||||
m_currMap = map;
|
||||
m_mapId = map->GetId();
|
||||
m_InstanceId = map->GetInstanceId();
|
||||
|
||||
#ifdef ELUNA
|
||||
delete elunaEvents;
|
||||
// On multithread replace this with a pointer to map's Eluna pointer stored in a map
|
||||
elunaEvents = new ElunaEventProcessor(&Eluna::GEluna, this);
|
||||
#endif
|
||||
|
||||
if (IsWorldObject())
|
||||
m_currMap->AddWorldObject(this);
|
||||
}
|
||||
@@ -2000,6 +2027,12 @@ void WorldObject::ResetMap()
|
||||
ASSERT(!IsInWorld());
|
||||
if (IsWorldObject())
|
||||
m_currMap->RemoveWorldObject(this);
|
||||
|
||||
#ifdef ELUNA
|
||||
delete elunaEvents;
|
||||
elunaEvents = NULL;
|
||||
#endif
|
||||
|
||||
m_currMap = NULL;
|
||||
//maybe not for corpse
|
||||
//m_mapId = 0;
|
||||
|
||||
Reference in New Issue
Block a user