From e8c5792c70127730615ab3944babadc7bbd12aa5 Mon Sep 17 00:00:00 2001 From: Foereaper Date: Thu, 25 Jul 2024 18:04:36 +0200 Subject: [PATCH] Rename core-specific preprocessors --- ElunaConfig.cpp | 8 ++++---- ElunaCreatureAI.h | 36 ++++++++++++++++++------------------ ElunaEventMgr.cpp | 2 +- ElunaEventMgr.h | 6 +++--- ElunaIncludes.h | 26 +++++++++++++------------- ElunaInstanceAI.cpp | 8 ++++---- ElunaInstanceAI.h | 18 +++++++++--------- ElunaLoader.cpp | 16 ++++++++-------- ElunaLoader.h | 6 +++--- ElunaTemplate.h | 4 ++-- ElunaUtility.cpp | 8 ++++---- ElunaUtility.h | 12 ++++++------ LuaEngine.cpp | 6 +++--- LuaEngine.h | 14 +++++++------- LuaFunctions.cpp | 2 +- hooks/CreatureHooks.cpp | 4 ++-- hooks/GossipHooks.cpp | 22 +++++++++++----------- hooks/ItemHooks.cpp | 2 +- hooks/PacketHooks.cpp | 4 ++-- hooks/ServerHooks.cpp | 10 +++++----- 20 files changed, 107 insertions(+), 107 deletions(-) diff --git a/ElunaConfig.cpp b/ElunaConfig.cpp index 7fad4f2185..5f0b6e5e4f 100644 --- a/ElunaConfig.cpp +++ b/ElunaConfig.cpp @@ -4,7 +4,7 @@ * Please see the included DOCS/LICENSE.md for more information */ -#if defined TRINITY +#if defined ELUNA_TRINITY #include "Config.h" #else #include "Config/Config.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 ea542edfac..a8a58e7eae 100644 --- a/ElunaCreatureAI.h +++ b/ElunaCreatureAI.h @@ -8,17 +8,17 @@ #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; #endif @@ -29,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) @@ -38,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; @@ -69,7 +69,7 @@ struct ElunaCreatureAI : NativeScriptedAI } } -#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 @@ -88,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 @@ -96,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); @@ -147,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 @@ -158,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 { @@ -195,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 { @@ -210,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 @@ -223,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 @@ -233,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 { @@ -262,7 +262,7 @@ struct ElunaCreatureAI : NativeScriptedAI } #endif -#if !defined TRINITY +#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 e7d469b665..d285d25cb5 100644 --- a/ElunaIncludes.h +++ b/ElunaIncludes.h @@ -8,7 +8,7 @@ #define _ELUNA_INCLUDES_H // Required -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "AccountMgr.h" #include "AuctionHouseMgr.h" #include "Bag.h" @@ -40,7 +40,7 @@ #include "TemporarySummon.h" #include "WorldPacket.h" #include "WorldSession.h" -#if defined TRINITY +#if defined ELUNA_TRINITY #include "Battleground.h" #include "Config.h" #include "DatabaseEnv.h" @@ -52,10 +52,10 @@ #include "SpellHistory.h" #include "SpellInfo.h" #include "WeatherMgr.h" -#elif defined VMANGOS +#elif defined ELUNA_VMANGOS #include "BasicAI.h" #include "SQLStorages.h" -#endif // TRINITY +#endif // ELUNA_TRINITY #if ELUNA_EXPANSION > CLASSIC #include "ArenaTeam.h" #endif @@ -106,7 +106,7 @@ #endif #endif -#if !defined TRINITY +#if !defined ELUNA_TRINITY #include "Config/Config.h" #include "BattleGroundMgr.h" #include "revision.h" @@ -120,7 +120,7 @@ typedef Opcodes OpcodesList; * 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 CMANGOS +#if defined ELUNA_CMANGOS #define CORE_NAME "cMaNGOS" #define CORE_VERSION REVISION_DATE " " REVISION_ID #if ELUNA_EXPANSION == CATA @@ -128,18 +128,18 @@ typedef Opcodes OpcodesList; #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) @@ -163,12 +163,12 @@ 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 ELUNA_EXPANSION >= CATA || defined VMANGOS +#if ELUNA_EXPANSION >= CATA || defined ELUNA_VMANGOS #define PLAYER_FIELD_LIFETIME_HONORABLE_KILLS PLAYER_FIELD_LIFETIME_HONORBALE_KILLS #endif @@ -180,12 +180,12 @@ typedef Opcodes OpcodesList; #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 930ca585b2..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" @@ -22,7 +22,7 @@ uint32 ElunaUtil::GetCurrTime() { -#if defined TRINITY +#if defined ELUNA_TRINITY return getMSTime(); #else return WorldTimer::getMSTime(); @@ -31,7 +31,7 @@ uint32 ElunaUtil::GetCurrTime() uint32 ElunaUtil::GetTimeDiff(uint32 oldMSTime) { -#if defined TRINITY +#if defined ELUNA_TRINITY return GetMSTimeDiffToNow(oldMSTime); #else return WorldTimer::getMSTimeDiff(oldMSTime, WorldTimer::getMSTime()); @@ -64,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); diff --git a/ElunaUtility.h b/ElunaUtility.h index 1b507c4ff0..0eb3b18b0a 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -14,11 +14,11 @@ #define WOTLK 2 #define CATA 3 -#if !defined CMANGOS +#if !defined ELUNA_CMANGOS #include "SharedDefines.h" #include "ObjectGuid.h" #include "Log.h" -#if defined TRINITY +#if defined ELUNA_TRINITY #include "QueryResult.h" #else #include "Database/QueryResult.h" @@ -35,7 +35,7 @@ #include #include -#if !defined VMANGOS +#if !defined ELUNA_VMANGOS #define USING_BOOST #endif @@ -51,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 @@ -69,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 { \ @@ -81,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 62b3bccdd2..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,7 +19,7 @@ #include "SharedDefines.h" #include "Weather.h" #include "World.h" -#if defined VMANGOS +#if defined ELUNA_VMANGOS #include "Player.h" #endif #else @@ -62,7 +62,7 @@ class WorldPacket; struct AreaTriggerEntry; struct AuctionEntry; -#if defined TRINITY +#if defined ELUNA_TRINITY class Battleground; class GameObjectAI; class InstanceScript; @@ -80,12 +80,12 @@ typedef ItemPrototype ItemTemplate; typedef SpellEffectIndex SpellEffIndex; typedef SpellEntry SpellInfo; -#if defined CMANGOS +#if defined ELUNA_CMANGOS class TemporarySpawn; typedef TemporarySpawn TempSummon; #endif -#if defined VMANGOS +#if defined ELUNA_VMANGOS class TemporarySummon; typedef TemporarySummon TempSummon; #endif @@ -130,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 @@ -239,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 diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 8d5fbfe1db..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()); 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/GossipHooks.cpp b/hooks/GossipHooks.cpp index 28166106e8..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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < 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 && ELUNA_EXPANSION < CATA +#if defined ELUNA_CMANGOS && ELUNA_EXPANSION < CATA *pPlayer->GetPlayerMenu() = original_menu; #else *pPlayer->PlayerTalkClass = original_menu; 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/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