diff --git a/ElunaConfig.cpp b/ElunaConfig.cpp index e5657bdc0a..5f0b6e5e4f 100644 --- a/ElunaConfig.cpp +++ b/ElunaConfig.cpp @@ -4,9 +4,9 @@ * Please see the included DOCS/LICENSE.md for more information */ -#if defined TRINITY || defined MANGOS +#if defined ELUNA_TRINITY #include "Config.h" -#elif defined CMANGOS || defined VMANGOS +#else #include "Config/Config.h" #endif #include "ElunaConfig.h" @@ -45,7 +45,7 @@ void ElunaConfig::Initialize() void ElunaConfig::SetConfig(ElunaConfigBoolValues index, char const* fieldname, bool defvalue) { -#if defined TRINITY +#if defined ELUNA_TRINITY SetConfig(index, sConfigMgr->GetBoolDefault(fieldname, defvalue)); #else SetConfig(index, sConfig.GetBoolDefault(fieldname, defvalue)); @@ -54,9 +54,9 @@ void ElunaConfig::SetConfig(ElunaConfigBoolValues index, char const* fieldname, void ElunaConfig::SetConfig(ElunaConfigStringValues index, char const* fieldname, std::string defvalue) { -#if defined TRINITY +#if defined ELUNA_TRINITY SetConfig(index, sConfigMgr->GetStringDefault(fieldname, defvalue)); -#elif defined CMANGOS +#elif defined ELUNA_CMANGOS SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue)); #else SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue.c_str())); diff --git a/ElunaCreatureAI.h b/ElunaCreatureAI.h index a1623b5c2b..a8a58e7eae 100644 --- a/ElunaCreatureAI.h +++ b/ElunaCreatureAI.h @@ -8,22 +8,19 @@ #define _ELUNA_CREATURE_AI_H #include "LuaEngine.h" -#if defined CMANGOS +#if defined ELUNA_CMANGOS #include "AI/BaseAI/CreatureAI.h" #endif -#if defined TRINITY +#if defined ELUNA_TRINITY struct ScriptedAI; typedef ScriptedAI NativeScriptedAI; -#elif defined CMANGOS +#elif defined ELUNA_CMANGOS class CreatureAI; typedef CreatureAI NativeScriptedAI; -#elif defined VMANGOS +#elif defined ELUNA_VMANGOS class BasicAI; typedef BasicAI NativeScriptedAI; -#else -class AggressorAI; -typedef AggressorAI NativeScriptedAI; #endif struct ElunaCreatureAI : NativeScriptedAI @@ -32,7 +29,7 @@ struct ElunaCreatureAI : NativeScriptedAI bool justSpawned; // used to delay movementinform hook (WP hook) std::vector< std::pair > movepoints; -#if !defined TRINITY +#if !defined ELUNA_TRINITY #define me m_creature #endif ElunaCreatureAI(Creature* creature) : NativeScriptedAI(creature), justSpawned(true) @@ -41,13 +38,13 @@ struct ElunaCreatureAI : NativeScriptedAI ~ElunaCreatureAI() { } //Called at World update tick -#if !defined TRINITY +#if !defined ELUNA_TRINITY void UpdateAI(const uint32 diff) override #else void UpdateAI(uint32 diff) override #endif { -#if !defined TRINITY +#if !defined ELUNA_TRINITY if (justSpawned) { justSpawned = false; @@ -67,16 +64,12 @@ struct ElunaCreatureAI : NativeScriptedAI if (!me->GetEluna()->UpdateAI(me, diff)) { -#if defined MANGOS - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) -#else if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC)) -#endif NativeScriptedAI::UpdateAI(diff); } } -#if defined TRINITY +#if defined ELUNA_TRINITY // Called for reaction when initially engaged - this will always happen _after_ JustEnteredCombat // Called at creature aggro either by MoveInLOS or Attack Start void JustEngagedWith(Unit* target) override @@ -95,7 +88,7 @@ struct ElunaCreatureAI : NativeScriptedAI #endif // Called at any Damage from any attacker (before damage apply) -#if defined TRINITY || defined CMANGOS +#if defined ELUNA_TRINITY || defined ELUNA_CMANGOS void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageType, SpellInfo const* spellInfo) override #else void DamageTaken(Unit* attacker, uint32& damage) override @@ -103,7 +96,7 @@ struct ElunaCreatureAI : NativeScriptedAI { if (!me->GetEluna()->DamageTaken(me, attacker, damage)) { -#if defined TRINITY || defined CMANGOS +#if defined ELUNA_TRINITY || defined ELUNA_CMANGOS NativeScriptedAI::DamageTaken(attacker, damage, damageType, spellInfo); #else NativeScriptedAI::DamageTaken(attacker, damage); @@ -154,7 +147,7 @@ struct ElunaCreatureAI : NativeScriptedAI NativeScriptedAI::AttackStart(target); } -#if defined TRINITY +#if defined ELUNA_TRINITY // Called for reaction at stopping attack at no attackers or targets void EnterEvadeMode(EvadeReason /*why*/) override #else @@ -165,7 +158,7 @@ struct ElunaCreatureAI : NativeScriptedAI NativeScriptedAI::EnterEvadeMode(); } -#if defined TRINITY +#if defined ELUNA_TRINITY // Called when creature appears in the world (spawn, respawn, grid load etc...) void JustAppeared() override { @@ -202,7 +195,7 @@ struct ElunaCreatureAI : NativeScriptedAI NativeScriptedAI::CorpseRemoved(respawnDelay); } -#if !defined TRINITY && !defined VMANGOS +#if !defined ELUNA_TRINITY && !defined ELUNA_VMANGOS // Enables use of MoveInLineOfSight bool IsVisible(Unit* who) const override { @@ -217,9 +210,9 @@ struct ElunaCreatureAI : NativeScriptedAI } // Called when hit by a spell -#if defined TRINITY +#if defined ELUNA_TRINITY void SpellHit(WorldObject* caster, SpellInfo const* spell) override -#elif defined VMANGOS +#elif defined ELUNA_VMANGOS void SpellHit(Unit* caster, SpellInfo const* spell) #else void SpellHit(Unit* caster, SpellInfo const* spell) override @@ -230,7 +223,7 @@ struct ElunaCreatureAI : NativeScriptedAI } // Called when spell hits a target -#if defined TRINITY +#if defined ELUNA_TRINITY void SpellHitTarget(WorldObject* target, SpellInfo const* spell) override #else void SpellHitTarget(Unit* target, SpellInfo const* spell) override @@ -240,7 +233,7 @@ struct ElunaCreatureAI : NativeScriptedAI NativeScriptedAI::SpellHitTarget(target, spell); } -#if defined TRINITY +#if defined ELUNA_TRINITY // Called when the creature is summoned successfully by other creature void IsSummonedBy(WorldObject* summoner) override { @@ -269,7 +262,7 @@ struct ElunaCreatureAI : NativeScriptedAI } #endif -#if defined MANGOS || defined CMANGOS +#if !defined ELUNA_TRINITY #undef me #endif }; diff --git a/ElunaEventMgr.cpp b/ElunaEventMgr.cpp index 7ee65316c2..b47afc99cc 100644 --- a/ElunaEventMgr.cpp +++ b/ElunaEventMgr.cpp @@ -6,7 +6,7 @@ #include "ElunaEventMgr.h" #include "LuaEngine.h" -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "Object.h" #else #include "Entities/Object.h" diff --git a/ElunaEventMgr.h b/ElunaEventMgr.h index 72a8f1d1cd..5575133354 100644 --- a/ElunaEventMgr.h +++ b/ElunaEventMgr.h @@ -9,16 +9,16 @@ #include "ElunaUtility.h" #include "Common.h" -#if defined TRINITY +#if defined ELUNA_TRINITY #include "Random.h" -#elif defined CMANGOS +#elif defined ELUNA_CMANGOS #include "Util/Util.h" #else #include "Util.h" #endif #include -#if defined TRINITY +#if defined ELUNA_TRINITY #include "Define.h" #else #include "Platform/Define.h" diff --git a/ElunaIncludes.h b/ElunaIncludes.h index 00535c0045..d285d25cb5 100644 --- a/ElunaIncludes.h +++ b/ElunaIncludes.h @@ -8,9 +8,10 @@ #define _ELUNA_INCLUDES_H // Required -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "AccountMgr.h" #include "AuctionHouseMgr.h" +#include "Bag.h" #include "Cell.h" #include "CellImpl.h" #include "Channel.h" @@ -39,6 +40,28 @@ #include "TemporarySummon.h" #include "WorldPacket.h" #include "WorldSession.h" +#if defined ELUNA_TRINITY +#include "Battleground.h" +#include "Config.h" +#include "DatabaseEnv.h" +#include "GitRevision.h" +#include "GroupMgr.h" +#include "MiscPackets.h" +#include "MotionMaster.h" +#include "ScriptedCreature.h" +#include "SpellHistory.h" +#include "SpellInfo.h" +#include "WeatherMgr.h" +#elif defined ELUNA_VMANGOS +#include "BasicAI.h" +#include "SQLStorages.h" +#endif // ELUNA_TRINITY +#if ELUNA_EXPANSION > CLASSIC +#include "ArenaTeam.h" +#endif +#if ELUNA_EXPANSION >= WOTLK +#include "Vehicle.h" +#endif #else #include "Accounts/AccountMgr.h" #include "AuctionHouse/AuctionHouseMgr.h" @@ -70,99 +93,53 @@ #include "Spells/SpellAuras.h" #include "Spells/SpellMgr.h" #include "Tools/Language.h" -#endif - -#if defined TRINITY -#include "Bag.h" -#include "Battleground.h" -#include "Config.h" -#include "DatabaseEnv.h" -#include "GameEventMgr.h" -#include "GitRevision.h" -#include "GroupMgr.h" -#include "MiscPackets.h" -#include "MotionMaster.h" -#include "ScriptedCreature.h" -#include "SpellHistory.h" -#include "SpellInfo.h" -#include "WeatherMgr.h" -#else -#include "Config/Config.h" -#if defined CMANGOS && defined CATA -#include "AI/BaseAI/AggressorAI.h" -#include "Server/SQLStorages.h" -#elif defined CMANGOS #include "AI/BaseAI/UnitAI.h" #include "Server/SQLStorages.h" -#elif defined VMANGOS -#include "BasicAI.h" -#include "Bag.h" -#else -#include "AggressorAI.h" -#include "SQLStorages.h" +#if ELUNA_EXPANSION > CLASSIC +#include "Arena/ArenaTeam.h" #endif -#include "BattleGroundMgr.h" -#if !defined CMANGOS -#include "SQLStorages.h" -#else -#include "Server/SQLStorages.h" +#if ELUNA_EXPANSION >= WOTLK +#include "Entities/Vehicle.h" #endif -#if defined MANGOS -#include "GitRevision.h" -#else -#include "revision.h" +#if ELUNA_EXPANSION >= CATA +#include "AI/BaseAI/AggressorAI.h" #endif #endif -#if !defined TBC && !defined CLASSIC -#if !defined CMANGOS -#include "Vehicle.h" -#else -#include "Entities/Vehicle.h" -#endif +#if !defined ELUNA_TRINITY +#include "Config/Config.h" +#include "BattleGroundMgr.h" +#include "revision.h" #endif -#if !defined CLASSIC +#if ELUNA_EXPANSION > CLASSIC typedef Opcodes OpcodesList; -#if !defined CMANGOS -#include "ArenaTeam.h" -#else -#include "Arena/ArenaTeam.h" -#endif #endif /* * Note: if you add or change a CORE_NAME or CORE_VERSION #define, * please update LuaGlobalFunctions::GetCoreName or LuaGlobalFunctions::GetCoreVersion documentation example string. */ -#if defined MANGOS -#define CORE_NAME "MaNGOS" -#define CORE_VERSION REVISION_NR -#if defined CATA -#define NUM_MSG_TYPES NUM_OPCODE_HANDLERS -#endif -#endif - -#if defined CMANGOS +#if defined ELUNA_CMANGOS #define CORE_NAME "cMaNGOS" #define CORE_VERSION REVISION_DATE " " REVISION_ID -#if defined CATA +#if ELUNA_EXPANSION == CATA #define NUM_MSG_TYPES MAX_OPCODE_TABLE_SIZE #endif #endif -#if defined VMANGOS +#if defined ELUNA_VMANGOS #define CORE_NAME "vMaNGOS" #define CORE_VERSION REVISION_HASH #define DEFAULT_LOCALE LOCALE_enUS #endif -#if defined TRINITY +#if defined ELUNA_TRINITY #define CORE_NAME "TrinityCore" #define REGEN_TIME_FULL #endif -#if defined TRINITY +#if defined ELUNA_TRINITY #define CORE_VERSION (GitRevision::GetFullVersion()) #define eWorld (sWorld) #define eMapMgr (sMapMgr) @@ -186,29 +163,29 @@ typedef Opcodes OpcodesList; #define TOTAL_LOCALES MAX_LOCALE #define TARGETICONCOUNT TARGET_ICON_COUNT #define MAX_TALENT_SPECS MAX_TALENT_SPEC_COUNT -#if !defined VMANGOS +#if !defined ELUNA_VMANGOS #define TEAM_NEUTRAL TEAM_INDEX_NEUTRAL #endif -#if (defined CATA && !defined MANGOS) || defined VMANGOS +#if ELUNA_EXPANSION >= CATA || defined ELUNA_VMANGOS #define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS #endif -#if defined TBC +#if ELUNA_EXPANSION == TBC #define SPELL_AURA_MOD_KILL_XP_PCT SPELL_AURA_MOD_XP_PCT #endif -#if defined CATA || defined MISTS || (defined WOTLK && !defined MANGOS) +#if ELUNA_EXPANSION >= WOTLK #define UNIT_BYTE2_FLAG_SANCTUARY UNIT_BYTE2_FLAG_SUPPORTABLE #endif -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS typedef TemporarySummon TempSummon; #else typedef TemporarySpawn TempSummon; #endif typedef SpellEntry SpellInfo; -#endif // TRINITY +#endif // ELUNA_TRINITY #endif // _ELUNA_INCLUDES_H diff --git a/ElunaInstanceAI.cpp b/ElunaInstanceAI.cpp index 388c36bfa2..4775f25b25 100644 --- a/ElunaInstanceAI.cpp +++ b/ElunaInstanceAI.cpp @@ -9,7 +9,7 @@ #include "lmarshal.h" -#if !defined TRINITY +#if !defined ELUNA_TRINITY void ElunaInstanceAI::Initialize() { ASSERT(!instance->GetEluna()->HasInstanceData(instance)); @@ -80,7 +80,7 @@ void ElunaInstanceAI::Load(const char* data) lua_pop(L, 1); // Stack: (empty) -#if !defined TRINITY +#if !defined ELUNA_TRINITY Initialize(); #endif } @@ -92,7 +92,7 @@ void ElunaInstanceAI::Load(const char* data) lua_pop(L, 1); // Stack: (empty) -#if !defined TRINITY +#if !defined ELUNA_TRINITY Initialize(); #endif } @@ -103,7 +103,7 @@ void ElunaInstanceAI::Load(const char* data) { ELUNA_LOG_ERROR("Error while decoding instance data: Data is not valid base-64"); -#if !defined TRINITY +#if !defined ELUNA_TRINITY Initialize(); #endif } diff --git a/ElunaInstanceAI.h b/ElunaInstanceAI.h index b69c208c1f..17d854d14d 100644 --- a/ElunaInstanceAI.h +++ b/ElunaInstanceAI.h @@ -8,10 +8,10 @@ #define _ELUNA_INSTANCE_DATA_H #include "LuaEngine.h" -#if defined TRINITY +#if defined ELUNA_TRINITY #include "InstanceScript.h" #include "Map.h" -#elif defined CMANGOS +#elif defined ELUNA_CMANGOS #include "Maps/InstanceData.h" #else #include "InstanceData.h" @@ -63,7 +63,7 @@ class ElunaInstanceAI : public InstanceData std::string lastSaveData; public: -#if defined TRINITY +#if defined ELUNA_TRINITY ElunaInstanceAI(Map* map) : InstanceData(map->ToInstanceMap()) { } @@ -73,7 +73,7 @@ class ElunaInstanceAI : public InstanceData } #endif -#if !defined TRINITY +#if !defined ELUNA_TRINITY void Initialize() override; #endif @@ -82,14 +82,14 @@ class ElunaInstanceAI : public InstanceData * data table to/from the core. */ void Load(const char* data) override; -#if defined TRINITY +#if defined ELUNA_TRINITY // Simply calls Save, since the functions are a bit different in name and data types on different cores std::string GetSaveData() override { return Save(); } const char* Save() const; -#elif defined VMANGOS +#elif defined ELUNA_VMANGOS const char* Save() const; #else const char* Save() const override; @@ -110,14 +110,14 @@ class ElunaInstanceAI : public InstanceData /* * These methods allow non-Lua scripts (e.g. DB, C++) to get/set instance data. */ -#if !defined VMANGOS +#if !defined ELUNA_VMANGOS uint32 GetData(uint32 key) const override; #else uint32 GetData(uint32 key) const; #endif void SetData(uint32 key, uint32 value) override; -#if !defined VMANGOS +#if !defined ELUNA_VMANGOS uint64 GetData64(uint32 key) const override; #else uint64 GetData64(uint32 key) const; @@ -148,7 +148,7 @@ class ElunaInstanceAI : public InstanceData instance->GetEluna()->OnPlayerEnterInstance(this, player); } -#if defined TRINITY +#if defined ELUNA_TRINITY void OnGameObjectCreate(GameObject* gameobject) override #else void OnObjectCreate(GameObject* gameobject) override diff --git a/ElunaLoader.cpp b/ElunaLoader.cpp index f925f7a069..2eda6b0435 100644 --- a/ElunaLoader.cpp +++ b/ElunaLoader.cpp @@ -25,9 +25,9 @@ namespace fs = std::filesystem; #include #endif -#if defined TRINITY +#if defined ELUNA_TRINITY #include "MapManager.h" -#elif defined CMANGOS +#elif defined ELUNA_CMANGOS #include "Maps/MapManager.h" #endif @@ -37,7 +37,7 @@ extern "C" { #include } -#if defined TRINITY +#if defined ELUNA_TRINITY void ElunaUpdateListener::handleFileAction(efsw::WatchID /*watchid*/, std::string const& dir, std::string const& filename, efsw::Action /*action*/, std::string /*oldFilename*/) { auto const path = fs::absolute(filename, dir); @@ -56,7 +56,7 @@ void ElunaUpdateListener::handleFileAction(efsw::WatchID /*watchid*/, std::strin ElunaLoader::ElunaLoader() : m_cacheState(SCRIPT_CACHE_NONE) { -#if defined TRINITY +#if defined ELUNA_TRINITY lua_scriptWatcher = -1; #endif } @@ -73,7 +73,7 @@ ElunaLoader::~ElunaLoader() if (m_reloadThread.joinable()) m_reloadThread.join(); -#if defined TRINITY +#if defined ELUNA_TRINITY if (lua_scriptWatcher >= 0) { lua_fileWatcher.removeWatch(lua_scriptWatcher); @@ -314,7 +314,7 @@ void ElunaLoader::ProcessScript(lua_State* L, std::string filename, const std::s ELUNA_LOG_DEBUG("[Eluna]: ProcessScript processed `%s` successfully", fullpath.c_str()); } -#if defined TRINITY +#if defined ELUNA_TRINITY void ElunaLoader::InitializeFileWatcher() { std::string lua_folderpath = sElunaConfig->GetConfig(CONFIG_ELUNA_SCRIPT_PATH); @@ -360,14 +360,14 @@ void ElunaLoader::ReloadElunaForMap(int mapId) if (mapId != RELOAD_CACHE_ONLY) { if (mapId == RELOAD_GLOBAL_STATE || mapId == RELOAD_ALL_STATES) -#if defined TRINITY +#if defined ELUNA_TRINITY if (Eluna* e = sWorld->GetEluna()) #else if (Eluna* e = sWorld.GetEluna()) #endif e->ReloadEluna(); -#if defined TRINITY +#if defined ELUNA_TRINITY sMapMgr->DoForAllMaps([&](Map* map) #else sMapMgr.DoForAllMaps([&](Map* map) diff --git a/ElunaLoader.h b/ElunaLoader.h index 298f29b84f..ff126dc500 100644 --- a/ElunaLoader.h +++ b/ElunaLoader.h @@ -10,7 +10,7 @@ #include "LuaEngine.h" -#if defined TRINITY +#if defined ELUNA_TRINITY #include #endif @@ -58,7 +58,7 @@ class ElunaLoader const std::string& GetRequirePath() const { return m_requirePath; } const std::string& GetRequireCPath() const { return m_requirecPath; } -#if defined TRINITY +#if defined ELUNA_TRINITY // efsw file watcher void InitializeFileWatcher(); efsw::FileWatcher lua_fileWatcher; @@ -82,7 +82,7 @@ class ElunaLoader std::thread m_reloadThread; }; -#if defined TRINITY +#if defined ELUNA_TRINITY /// File watcher responsible for watching lua scripts class ElunaUpdateListener : public efsw::FileWatchListener { diff --git a/ElunaTemplate.h b/ElunaTemplate.h index cd0c1cb98a..0443e3a733 100644 --- a/ElunaTemplate.h +++ b/ElunaTemplate.h @@ -16,13 +16,13 @@ extern "C" #include "LuaEngine.h" #include "ElunaUtility.h" #include "ElunaCompat.h" -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "SharedDefines.h" #else #include "Globals/SharedDefines.h" #endif -#if defined TRINITY +#if defined ELUNA_TRINITY #include "UniqueTrackablePtr.h" #endif diff --git a/ElunaUtility.cpp b/ElunaUtility.cpp index 1d0bc3a5e2..01524fc6fe 100644 --- a/ElunaUtility.cpp +++ b/ElunaUtility.cpp @@ -5,7 +5,7 @@ */ #include "ElunaUtility.h" -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "World.h" #include "Object.h" #include "Unit.h" @@ -19,13 +19,10 @@ #include "Server/DBCStores.h" #include "Util/Timer.h" #endif -#if defined MANGOS -#include "Timer.h" -#endif uint32 ElunaUtil::GetCurrTime() { -#if !defined CMANGOS && !defined VMANGOS +#if defined ELUNA_TRINITY return getMSTime(); #else return WorldTimer::getMSTime(); @@ -34,7 +31,7 @@ uint32 ElunaUtil::GetCurrTime() uint32 ElunaUtil::GetTimeDiff(uint32 oldMSTime) { -#if !defined CMANGOS && !defined VMANGOS +#if defined ELUNA_TRINITY return GetMSTimeDiffToNow(oldMSTime); #else return WorldTimer::getMSTimeDiff(oldMSTime, WorldTimer::getMSTime()); @@ -67,7 +64,7 @@ ElunaUtil::WorldObjectInRangeCheck::WorldObjectInRangeCheck(bool nearest, WorldO if (GameObject const* go = i_obj->ToGameObject()) i_obj_unit = go->GetOwner(); if (!i_obj_unit) -#if !defined VMANGOS +#if !defined ELUNA_VMANGOS i_obj_fact = sFactionTemplateStore.LookupEntry(14); #else i_obj_fact = sObjectMgr.GetFactionTemplateEntry(14); @@ -101,16 +98,8 @@ bool ElunaUtil::WorldObjectInRangeCheck::operator()(WorldObject* u) { if (i_obj_fact) { -#if (defined TRINITY || CMANGOS || VMANGOS) && !defined CATA - if ((i_obj_fact->IsHostileTo(*target->GetFactionTemplateEntry())) != (i_hostile == 1)) - return false; -#elif defined CATA && defined CMANGOS if ((i_obj_fact->IsHostileTo(*target->GetFactionTemplateEntry())) != (i_hostile == 1)) return false; -#else - if ((i_obj_fact->IsHostileTo(*target->getFactionTemplateEntry())) != (i_hostile == 1)) - return false; -#endif } else if (i_hostile == 1) return false; diff --git a/ElunaUtility.h b/ElunaUtility.h index 5f3d33d729..0eb3b18b0a 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -9,21 +9,23 @@ #include "Common.h" -#if !defined CMANGOS +#define CLASSIC 0 +#define TBC 1 +#define WOTLK 2 +#define CATA 3 + +#if !defined ELUNA_CMANGOS #include "SharedDefines.h" #include "ObjectGuid.h" -#else -#include "Globals/SharedDefines.h" -#include "Entities/ObjectGuid.h" -#endif - -#if defined TRINITY -#include "QueryResult.h" #include "Log.h" -#elif defined VMANGOS +#if defined ELUNA_TRINITY +#include "QueryResult.h" +#else #include "Database/QueryResult.h" -#include "Log.h" +#endif #else +#include "Globals/SharedDefines.h" +#include "Entities/ObjectGuid.h" #include "Database/QueryResult.h" #include "Log/Log.h" #endif @@ -33,7 +35,7 @@ #include #include -#if !defined MANGOS && !defined VMANGOS +#if !defined ELUNA_VMANGOS #define USING_BOOST #endif @@ -49,7 +51,7 @@ #error Eluna could not determine platform #endif -#if defined TRINITY +#if defined ELUNA_TRINITY typedef QueryResult ElunaQuery; #define GET_GUID GetGUID #define HIGHGUID_PLAYER HighGuid::Player @@ -67,7 +69,7 @@ typedef QueryResult ElunaQuery; #define HIGHGUID_GROUP HighGuid::Group #endif -#if defined TRINITY +#if defined ELUNA_TRINITY #include "fmt/printf.h" #define ELUNA_LOG_TC_FMT(TC_LOG_MACRO, ...) \ try { \ @@ -79,7 +81,7 @@ typedef QueryResult ElunaQuery; #define ELUNA_LOG_INFO(...) ELUNA_LOG_TC_FMT(TC_LOG_INFO, __VA_ARGS__); #define ELUNA_LOG_ERROR(...) ELUNA_LOG_TC_FMT(TC_LOG_ERROR, __VA_ARGS__); #define ELUNA_LOG_DEBUG(...) ELUNA_LOG_TC_FMT(TC_LOG_DEBUG, __VA_ARGS__); -#elif defined VMANGOS +#elif defined ELUNA_VMANGOS typedef std::shared_ptr ElunaQuery; #define ASSERT MANGOS_ASSERT #define ELUNA_LOG_INFO(...) sLog.Out(LOG_ELUNA, LOG_LVL_BASIC,__VA_ARGS__); diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 12e3052e21..6e29252662 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -971,7 +971,7 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc luaL_unref(L, LUA_REGISTRYINDEX, functionRef); std::ostringstream oss; oss << "regtype " << static_cast(regtype) << ", event " << event_id << ", entry " << entry << ", guid " << -#if defined TRINITY +#if defined ELUNA_TRINITY guid.ToHexString() #else guid.GetRawValue() @@ -984,13 +984,13 @@ int Eluna::Register(uint8 regtype, uint32 entry, ObjectGuid guid, uint32 instanc void Eluna::UpdateEluna(uint32 diff) { if (reload && sElunaLoader->GetCacheState() == SCRIPT_CACHE_READY) -#if defined TRINITY +#if defined ELUNA_TRINITY if(!GetQueryProcessor().HasPendingCallbacks()) #endif _ReloadEluna(); eventMgr->globalProcessor->Update(diff); -#if defined TRINITY +#if defined ELUNA_TRINITY GetQueryProcessor().ProcessReadyCallbacks(); #endif } diff --git a/LuaEngine.h b/LuaEngine.h index 76cebfce4f..0c1a84da86 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -11,7 +11,7 @@ #include "ElunaUtility.h" #include "Hooks.h" -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "DBCEnums.h" #include "Group.h" #include "Item.h" @@ -19,6 +19,9 @@ #include "SharedDefines.h" #include "Weather.h" #include "World.h" +#if defined ELUNA_VMANGOS +#include "Player.h" +#endif #else #include "Entities/Item.h" #include "Globals/SharedDefines.h" @@ -27,16 +30,8 @@ #include "Server/DBCEnums.h" #include "Weather/Weather.h" #include "World/World.h" -#endif - -#if !defined TRINITY -#if !defined CMANGOS -#include "Player.h" -#else #include "Entities/Player.h" #endif -#endif - #include #include @@ -67,7 +62,7 @@ class WorldPacket; struct AreaTriggerEntry; struct AuctionEntry; -#if defined TRINITY +#if defined ELUNA_TRINITY class Battleground; class GameObjectAI; class InstanceScript; @@ -77,7 +72,7 @@ struct ItemTemplate; typedef Battleground BattleGround; typedef BattlegroundTypeId BattleGroundTypeId; typedef InstanceScript InstanceData; -#else // MANGOS && CMANGOS && VMANGOS +#else class InstanceData; struct ItemPrototype; struct SpellEntry; @@ -85,19 +80,21 @@ typedef ItemPrototype ItemTemplate; typedef SpellEffectIndex SpellEffIndex; typedef SpellEntry SpellInfo; -#if defined CMANGOS +#if defined ELUNA_CMANGOS class TemporarySpawn; typedef TemporarySpawn TempSummon; -#else +#endif + +#if defined ELUNA_VMANGOS class TemporarySummon; typedef TemporarySummon TempSummon; #endif -#if defined CLASSIC +#if ELUNA_EXPANSION == CLASSIC typedef int Difficulty; #endif -#if !defined CLASSIC && !defined TBC +#if ELUNA_EXPANSION >= WOTLK class VehicleInfo; typedef VehicleInfo Vehicle; #endif @@ -133,7 +130,7 @@ enum MethodRegisterState #define ELUNA_STATE_PTR "Eluna State Ptr" -#if defined TRINITY +#if defined ELUNA_TRINITY #define ELUNA_GAME_API TC_GAME_API #define TRACKABLE_PTR_NAMESPACE ::Trinity:: #else @@ -242,7 +239,7 @@ class ELUNA_GAME_API Eluna lua_State* L; EventMgr* eventMgr; -#if defined TRINITY +#if defined ELUNA_TRINITY QueryCallbackProcessor queryProcessor; QueryCallbackProcessor& GetQueryProcessor() { return queryProcessor; } #endif @@ -461,7 +458,7 @@ class ELUNA_GAME_API Eluna bool OnQuestAccept(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest); bool OnQuestReward(Player* pPlayer, GameObject* pGameObject, Quest const* pQuest, uint32 opt); void GetDialogStatus(const Player* pPlayer, const GameObject* pGameObject); -#if !defined CLASSIC && !defined TBC +#if ELUNA_EXPANSION >= WOTLK void OnDestroyed(GameObject* pGameObject, WorldObject* attacker); void OnDamaged(GameObject* pGameObject, WorldObject* attacker); #endif @@ -489,7 +486,7 @@ class ELUNA_GAME_API Eluna void OnFreeTalentPointsChanged(Player* pPlayer, uint32 newPoints); void OnTalentsReset(Player* pPlayer, bool noCost); void OnMoneyChanged(Player* pPlayer, int32& amount); -#if defined CATA +#if ELUNA_EXPANSION >= CATA void OnMoneyChanged(Player* pPlayer, int64& amount); #endif void OnGiveXP(Player* pPlayer, uint32& amount, Unit* pVictim); @@ -517,7 +514,7 @@ class ELUNA_GAME_API Eluna void HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code); void OnAchievementComplete(Player* pPlayer, uint32 achievementId); -#if !defined CLASSIC && !defined TBC +#if ELUNA_EXPANSION >= WOTLK /* Vehicle */ void OnInstall(Vehicle* vehicle); void OnUninstall(Vehicle* vehicle); @@ -546,11 +543,9 @@ class ELUNA_GAME_API Eluna void OnCreate(Guild* guild, Player* leader, const std::string& name); void OnDisband(Guild* guild); void OnMemberWitdrawMoney(Guild* guild, Player* player, uint32& amount, bool isRepair); -#if defined CATA - void OnMemberWitdrawMoney(Guild* guild, Player* player, uint64& amount, bool isRepair); -#endif void OnMemberDepositMoney(Guild* guild, Player* player, uint32& amount); -#if defined CATA +#if ELUNA_EXPANSION >= CATA + void OnMemberWitdrawMoney(Guild* guild, Player* player, uint64& amount, bool isRepair); void OnMemberDepositMoney(Guild* guild, Player* player, uint64& amount); #endif void OnItemMove(Guild* guild, Player* player, Item* pItem, bool isSrcBank, uint8 srcContainer, uint8 srcSlotId, bool isDestBank, uint8 destContainer, uint8 destSlotId); diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 634863879c..91d8d404f1 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -117,7 +117,7 @@ template<> int ElunaTemplate::Equal(lua_State* L) { Eluna* E = Eluna template<> int ElunaTemplate::ToString(lua_State* L) { Eluna* E = Eluna::GetEluna(L); -#if defined TRINITY +#if defined ELUNA_TRINITY E->Push(E->CHECKVAL(1).ToString()); #else E->Push(E->CHECKVAL(1).GetString()); @@ -167,7 +167,7 @@ void RegisterFunctions(Eluna* E) ElunaTemplate::SetMethods(E, LuaObject::ObjectMethods); ElunaTemplate::SetMethods(E, LuaItem::ItemMethods); -#if !defined CLASSIC && !defined TBC +#if ELUNA_EXPANSION >= WOTLK ElunaTemplate::Register(E, "Vehicle"); ElunaTemplate::SetMethods(E, LuaVehicle::VehicleMethods); #endif diff --git a/hooks/CreatureHooks.cpp b/hooks/CreatureHooks.cpp index a48ab89e27..dbf2ad3745 100644 --- a/hooks/CreatureHooks.cpp +++ b/hooks/CreatureHooks.cpp @@ -295,7 +295,7 @@ bool Eluna::SpellHitTarget(Creature* me, WorldObject* target, SpellInfo const* s return CallAllFunctionsBool(CreatureEventBindings, CreatureUniqueBindings, entry_key, unique_key); } -#if defined TRINITY +#if defined ELUNA_TRINITY bool Eluna::SummonedCreatureDies(Creature* me, Creature* summon, Unit* killer) { @@ -324,4 +324,4 @@ bool Eluna::OwnerAttacked(Creature* me, Unit* target) return CallAllFunctionsBool(CreatureEventBindings, CreatureUniqueBindings, entry_key, unique_key); } -#endif // TRINITY +#endif // ELUNA_TRINITY diff --git a/hooks/GameObjectHooks.cpp b/hooks/GameObjectHooks.cpp index a19cea8e9c..831ec48d9f 100644 --- a/hooks/GameObjectHooks.cpp +++ b/hooks/GameObjectHooks.cpp @@ -69,7 +69,7 @@ void Eluna::GetDialogStatus(const Player* pPlayer, const GameObject* pGameObject CallAllFunctions(GameObjectEventBindings, key); } -#if !defined(CLASSIC) && !defined(TBC) +#if ELUNA_EXPANSION >= WOTLK void Eluna::OnDestroyed(GameObject* pGameObject, WorldObject* attacker) { START_HOOK(GAMEOBJECT_EVENT_ON_DESTROYED, pGameObject->GetEntry()); diff --git a/hooks/GossipHooks.cpp b/hooks/GossipHooks.cpp index 361a77c22f..587e56f7d1 100644 --- a/hooks/GossipHooks.cpp +++ b/hooks/GossipHooks.cpp @@ -26,7 +26,7 @@ using namespace Hooks; bool Eluna::OnGossipHello(Player* pPlayer, GameObject* pGameObject) { START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_HELLO, pGameObject->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -39,7 +39,7 @@ bool Eluna::OnGossipHello(Player* pPlayer, GameObject* pGameObject) bool Eluna::OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action) { START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_SELECT, pGameObject->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -54,7 +54,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, GameObject* pGameObject, uint32 send bool Eluna::OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 sender, uint32 action, const char* code) { START_HOOK_WITH_RETVAL(GameObjectGossipBindings, GOSSIP_EVENT_ON_SELECT, pGameObject->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -70,7 +70,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, GameObject* pGameObject, uint32 void Eluna::HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 sender, uint32 action, const std::string& code) { START_HOOK(PlayerGossipBindings, GOSSIP_EVENT_ON_SELECT, menuId); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -91,7 +91,7 @@ void Eluna::HandleGossipSelectOption(Player* pPlayer, uint32 menuId, uint32 send bool Eluna::OnItemGossip(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/) { START_HOOK_WITH_RETVAL(ItemGossipBindings, GOSSIP_EVENT_ON_HELLO, pItem->GetEntry(), true); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -104,7 +104,7 @@ bool Eluna::OnItemGossip(Player* pPlayer, Item* pItem, SpellCastTargets const& / void Eluna::HandleGossipSelectOption(Player* pPlayer, Item* pItem, uint32 sender, uint32 action, const std::string& code) { START_HOOK(ItemGossipBindings, GOSSIP_EVENT_ON_SELECT, pItem->GetEntry()); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -125,7 +125,7 @@ void Eluna::HandleGossipSelectOption(Player* pPlayer, Item* pItem, uint32 sender bool Eluna::OnGossipHello(Player* pPlayer, Creature* pCreature) { START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_HELLO, pCreature->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA pPlayer->GetPlayerMenu()->ClearMenus(); #else pPlayer->PlayerTalkClass->ClearMenus(); @@ -138,7 +138,7 @@ bool Eluna::OnGossipHello(Player* pPlayer, Creature* pCreature) bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action) { START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_SELECT, pCreature->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA auto original_menu = *pPlayer->GetPlayerMenu(); pPlayer->GetPlayerMenu()->ClearMenus(); #else @@ -151,7 +151,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, HookPush(action); auto preventDefault = CallAllFunctionsBool(CreatureGossipBindings, key, true); if (!preventDefault) { -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA *pPlayer->GetPlayerMenu() = original_menu; #else *pPlayer->PlayerTalkClass = original_menu; @@ -163,7 +163,7 @@ bool Eluna::OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 sender, bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 action, const char* code) { START_HOOK_WITH_RETVAL(CreatureGossipBindings, GOSSIP_EVENT_ON_SELECT, pCreature->GetEntry(), false); -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA auto original_menu = *pPlayer->GetPlayerMenu(); pPlayer->GetPlayerMenu()->ClearMenus(); #else @@ -177,7 +177,7 @@ bool Eluna::OnGossipSelectCode(Player* pPlayer, Creature* pCreature, uint32 send HookPush(code); auto preventDefault = CallAllFunctionsBool(CreatureGossipBindings, key, true); if (!preventDefault) { -#if defined CMANGOS && !defined CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA *pPlayer->GetPlayerMenu() = original_menu; #else *pPlayer->PlayerTalkClass = original_menu; diff --git a/hooks/GuildHooks.cpp b/hooks/GuildHooks.cpp index cf46ad46c9..4daadb78e0 100644 --- a/hooks/GuildHooks.cpp +++ b/hooks/GuildHooks.cpp @@ -94,7 +94,7 @@ void Eluna::OnMemberWitdrawMoney(Guild* guild, Player* player, uint32& amount, b CleanUpStack(4); } -#if defined CATA +#if ELUNA_EXPANSION >= CATA void Eluna::OnMemberWitdrawMoney(Guild* guild, Player* player, uint64& amount, bool isRepair) { START_HOOK(GUILD_EVENT_ON_MONEY_WITHDRAW); @@ -149,7 +149,7 @@ void Eluna::OnMemberDepositMoney(Guild* guild, Player* player, uint32& amount) CleanUpStack(3); } -#if defined CATA +#if ELUNA_EXPANSION >= CATA void Eluna::OnMemberDepositMoney(Guild* guild, Player* player, uint64& amount) { START_HOOK(GUILD_EVENT_ON_MONEY_DEPOSIT); diff --git a/hooks/ItemHooks.cpp b/hooks/ItemHooks.cpp index aaecf6648a..a7cd3c4a6c 100644 --- a/hooks/ItemHooks.cpp +++ b/hooks/ItemHooks.cpp @@ -72,7 +72,7 @@ bool Eluna::OnItemUse(Player* pPlayer, Item* pItem, SpellCastTargets const& targ START_HOOK_WITH_RETVAL(ITEM_EVENT_ON_USE, pItem->GetEntry(), true); HookPush(pPlayer); HookPush(pItem); -#if defined TRINITY +#if defined ELUNA_TRINITY if (GameObject* target = targets.GetGOTarget()) HookPush(target); else if (Item* target = targets.GetItemTarget()) diff --git a/hooks/PacketHooks.cpp b/hooks/PacketHooks.cpp index 59f323e854..bf5fd37383 100644 --- a/hooks/PacketHooks.cpp +++ b/hooks/PacketHooks.cpp @@ -101,7 +101,7 @@ void Eluna::OnPacketReceiveAny(Player* player, WorldPacket& packet, bool& result if (lua_isuserdata(L, r + 1)) if (WorldPacket* data = CHECKOBJ(r + 1, false)) { -#if defined TRINITY || defined VMANGOS +#if defined ELUNA_TRINITY || defined ELUNA_VMANGOS packet = std::move(*data); #else packet = *data; @@ -131,7 +131,7 @@ void Eluna::OnPacketReceiveOne(Player* player, WorldPacket& packet, bool& result if (lua_isuserdata(L, r + 1)) if (WorldPacket* data = CHECKOBJ(r + 1, false)) { -#if defined TRINITY || defined VMANGOS +#if defined ELUNA_TRINITY || defined ELUNA_VMANGOS packet = std::move(*data); #else packet = *data; diff --git a/hooks/PlayerHooks.cpp b/hooks/PlayerHooks.cpp index 4abb25c72b..60584b973d 100644 --- a/hooks/PlayerHooks.cpp +++ b/hooks/PlayerHooks.cpp @@ -280,7 +280,7 @@ void Eluna::OnMoneyChanged(Player* pPlayer, int32& amount) CleanUpStack(2); } -#if defined CATA +#if ELUNA_EXPANSION >= CATA void Eluna::OnMoneyChanged(Player* pPlayer, int64& amount) { START_HOOK(PLAYER_EVENT_ON_MONEY_CHANGE); diff --git a/hooks/ServerHooks.cpp b/hooks/ServerHooks.cpp index 133161fe14..b9edd76db7 100644 --- a/hooks/ServerHooks.cpp +++ b/hooks/ServerHooks.cpp @@ -111,7 +111,7 @@ bool Eluna::OnAreaTrigger(Player* pPlayer, AreaTriggerEntry const* pTrigger) { START_HOOK_WITH_RETVAL(TRIGGER_EVENT_ON_TRIGGER, false); HookPush(pPlayer); -#if defined TRINITY +#if defined ELUNA_TRINITY HookPush(pTrigger->ID); #else HookPush(pTrigger->id); @@ -135,7 +135,7 @@ void Eluna::OnAdd(AuctionHouseObject* /*ah*/, AuctionEntry* entry) { Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER)); -#if defined TRINITY +#if defined ELUNA_TRINITY Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow); uint32 expiretime = entry->expire_time; #else @@ -162,7 +162,7 @@ void Eluna::OnRemove(AuctionHouseObject* /*ah*/, AuctionEntry* entry) { Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER)); -#if defined TRINITY +#if defined ELUNA_TRINITY Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow); uint32 expiretime = entry->expire_time; #else @@ -190,7 +190,7 @@ void Eluna::OnSuccessful(AuctionHouseObject* /*ah*/, AuctionEntry* entry) { Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER)); -#if defined TRINITY +#if defined ELUNA_TRINITY Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow); uint32 expiretime = entry->expire_time; #else @@ -217,7 +217,7 @@ void Eluna::OnExpire(AuctionHouseObject* /*ah*/, AuctionEntry* entry) { Player* owner = eObjectAccessor()FindPlayer(MAKE_NEW_GUID(entry->owner, 0, HIGHGUID_PLAYER)); -#if defined TRINITY +#if defined ELUNA_TRINITY Item* item = eAuctionMgr->GetAItem(entry->itemGUIDLow); uint32 expiretime = entry->expire_time; #else diff --git a/hooks/VehicleHooks.cpp b/hooks/VehicleHooks.cpp index f19ede836b..f24f4f1c4e 100644 --- a/hooks/VehicleHooks.cpp +++ b/hooks/VehicleHooks.cpp @@ -10,7 +10,7 @@ #include "BindingMap.h" #include "ElunaTemplate.h" -#if !defined(CLASSIC) && !defined(TBC) +#if ELUNA_EXPANSION >= WOTLK using namespace Hooks; @@ -58,4 +58,4 @@ void Eluna::OnRemovePassenger(Vehicle* vehicle, Unit* passenger) CallAllFunctions(VehicleEventBindings, key); } -#endif // !CLASSIC && !TBC +#endif