Eluna fix mangos build

This commit is contained in:
Rochet2
2014-06-02 01:45:28 +03:00
committed by Foereaper
parent b1f85bfc21
commit 19b03dcbcf
10 changed files with 112 additions and 91 deletions

View File

@@ -19,10 +19,13 @@ extern "C"
#include "SharedDefines.h"
#include <ace/Singleton.h>
#include <ace/Atomic_Op.h>
// enums
// enums & singletons
#ifdef MANGOS
#include "AccountMgr.h"
#include "Config/Config.h"
#include "Player.h"
#else
#include "Config.h"
#include "GameObjectAI.h"
#endif
#include "Group.h"
@@ -34,7 +37,7 @@ extern "C"
typedef SpellEffectIndex SpellEffIndex;
typedef SpellEntry SpellInfo;
typedef ItemPrototype ItemTemplate;
#define GetTemplate GetProto
#define GetTemplate GetProto
#ifdef CLASSIC
typedef int Difficulty;
#endif
@@ -61,6 +64,7 @@ class Player;
class Quest;
class Spell;
class SpellCastTargets;
class TemporarySummon;
class Transport;
class Unit;
class Weather;
@@ -77,20 +81,13 @@ typedef VehicleInfo Vehicle;
#endif
#ifdef MANGOS
#undef sWorld
#undef sMapMgr
#undef sConfigMgr
#undef sGuildMgr
#undef sObjectMgr
#undef sAccountMgr
#undef sObjectAccessor
#define sWorld (&MaNGOS::Singleton<World>::Instance())
#define sMapMgr (&MapManager::Instance())
#define sConfigMgr (&MaNGOS::Singleton<Config>::Instance())
#define sGuildMgr (&MaNGOS::Singleton<GuildMgr>::Instance())
#define sObjectMgr (&MaNGOS::Singleton<ObjectMgr>::Instance())
#define sAccountMgr (&MaNGOS::Singleton<AccountMgr>::Instance())
#define sObjectAccessor (&ObjectAccessor::Instance())
#define eWorld (&sWorld)
#define eMapMgr (&sMapMgr)
#define eConfigMgr (&sConfig)
#define eGuildMgr (&sGuildMgr)
#define eObjectMgr (&sObjectMgr)
#define eAccountMgr (&sAccountMgr)
#define eObjectAccessor (&sObjectAccessor)
#define MAKE_NEW_GUID(l, e, h) ObjectGuid(h, e, l)
#define GET_GUID GetObjectGuid
#define GetGameObjectTemplate GetGameObjectInfo
@@ -112,6 +109,7 @@ typedef TemporarySummon TempSummon;
#define GUID_ENPART(guid) ObjectGuid(guid).GetEntry()
#define GUID_LOPART(guid) ObjectGuid(guid).GetCounter()
#define GUID_HIPART(guid) ObjectGuid(guid).GetHigh()
#define ASSERT MANGOS_ASSERT
enum SelectAggroTarget
{
SELECT_TARGET_RANDOM = 0, // Just selects a random target
@@ -128,6 +126,13 @@ enum SelectAggroTarget
#define Opcodes OpcodesList
#endif
#else
#define eWorld (sWorld)
#define eMapMgr (sMapMgr)
#define eConfigMgr (sConfigMgr)
#define eGuildMgr (sGuildMgr)
#define eObjectMgr (sObjectMgr)
#define eAccountMgr (sAccountMgr)
#define eObjectAccessor (sObjectAccessor)
#ifndef CATA
typedef uint64 ObjectGuid;
#endif
@@ -493,6 +498,24 @@ public:
return ElunaTemplate<T>::check(L, narg, error);
}
static inline uint32 GetCurrTime()
{
#ifdef MANGOS
return WorldTimer::getMSTime();
#else
return getMSTime();
#endif
}
static inline uint32 GetTimeDiff(uint32 oldMSTime)
{
#ifdef MANGOS
return WorldTimer::getMSTimeDiff(oldMSTime, GetCurrTime());
#else
return GetMSTimeDiffToNow(uint32 oldMSTime);
#endif
}
struct ObjectGUIDCheck
{
ObjectGUIDCheck(ObjectGuid guid): _guid(guid) {}