From f166732b49af0cd5a2f05cd45ed3e68ef5ecd3a2 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Tue, 6 May 2014 13:30:11 +0300 Subject: [PATCH] Eluna fix TC define changes --- GlobalMethods.h | 2 +- HookMgr.cpp | 64 ++++++++++++++++++++++++------------------------- LuaEngine.h | 1 - 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/GlobalMethods.h b/GlobalMethods.h index 268f0c3..5486bea 100644 --- a/GlobalMethods.h +++ b/GlobalMethods.h @@ -744,7 +744,7 @@ namespace LuaGlobalFunctions if (save) { Creature* creature = new Creature(); - if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, phase, entry, 0, 0, x, y, z, o)) + if (!creature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, phase, entry, x, y, z, o)) { delete creature; return 0; diff --git a/HookMgr.cpp b/HookMgr.cpp index 7251e0d..3785c60 100644 --- a/HookMgr.cpp +++ b/HookMgr.cpp @@ -235,7 +235,7 @@ public: ElunaWorldAI() : WorldScript("ElunaWorldAI") {} ~ElunaWorldAI() {} - void OnOpenStateChange(bool open) OVERRIDE + void OnOpenStateChange(bool open) override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_OPEN_STATE_CHANGE)) return; @@ -246,7 +246,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnConfigLoad(bool reload) OVERRIDE + void OnConfigLoad(bool reload) override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_CONFIG_LOAD)) return; @@ -257,7 +257,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnMotdChange(std::string& newMotd) OVERRIDE + void OnMotdChange(std::string& newMotd) override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_MOTD_CHANGE)) return; @@ -268,7 +268,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnShutdownInitiate(ShutdownExitCode code, ShutdownMask mask) OVERRIDE + void OnShutdownInitiate(ShutdownExitCode code, ShutdownMask mask) override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_SHUTDOWN_INIT)) return; @@ -280,7 +280,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnShutdownCancel() OVERRIDE + void OnShutdownCancel() override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_SHUTDOWN_CANCEL)) return; @@ -290,7 +290,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnUpdate(uint32 diff) OVERRIDE + void OnUpdate(uint32 diff) override { sEluna->m_EventMgr.Update(diff); if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_UPDATE)) @@ -302,7 +302,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnStartup() OVERRIDE + void OnStartup() override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_STARTUP)) return; @@ -312,7 +312,7 @@ public: sEluna->ServerEventBindings.EndCall(); } - void OnShutdown() OVERRIDE + void OnShutdown() override { if (!sEluna->ServerEventBindings.HasEvents(WORLD_EVENT_ON_SHUTDOWN)) return; @@ -1651,9 +1651,9 @@ struct ElunaCreatureAI : ScriptedAI //Called at World update tick #ifdef MANGOS - void UpdateAI(const uint32 diff) OVERRIDE + void UpdateAI(const uint32 diff) override #else - void UpdateAI(uint32 diff) OVERRIDE + void UpdateAI(uint32 diff) override #endif { #ifdef MANGOS @@ -1676,7 +1676,7 @@ struct ElunaCreatureAI : ScriptedAI //Called for reaction at enter to combat if not in combat yet (enemy can be NULL) //Called at creature aggro either by MoveInLOS or Attack Start - void EnterCombat(Unit* target) OVERRIDE + void EnterCombat(Unit* target) override { ScriptedAI::EnterCombat(target); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_ENTER_COMBAT); @@ -1691,7 +1691,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called at any Damage from any attacker (before damage apply) - void DamageTaken(Unit* attacker, uint32& damage) OVERRIDE + void DamageTaken(Unit* attacker, uint32& damage) override { ScriptedAI::DamageTaken(attacker, damage); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_DAMAGE_TAKEN); @@ -1707,7 +1707,7 @@ struct ElunaCreatureAI : ScriptedAI } //Called at creature death - void JustDied(Unit* killer) OVERRIDE + void JustDied(Unit* killer) override { ScriptedAI::JustDied(killer); On_Reset(); @@ -1723,7 +1723,7 @@ struct ElunaCreatureAI : ScriptedAI } //Called at creature killing another unit - void KilledUnit(Unit* victim) OVERRIDE + void KilledUnit(Unit* victim) override { ScriptedAI::KilledUnit(victim); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_TARGET_DIED); @@ -1738,7 +1738,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when the creature summon successfully other creature - void JustSummoned(Creature* summon) OVERRIDE + void JustSummoned(Creature* summon) override { ScriptedAI::JustSummoned(summon); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_JUST_SUMMONED_CREATURE); @@ -1753,7 +1753,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when a summoned creature is despawned - void SummonedCreatureDespawn(Creature* summon) OVERRIDE + void SummonedCreatureDespawn(Creature* summon) override { ScriptedAI::SummonedCreatureDespawn(summon); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_SUMMONED_CREATURE_DESPAWN); @@ -1768,7 +1768,7 @@ struct ElunaCreatureAI : ScriptedAI } //Called at waypoint reached or PointMovement end - void MovementInform(uint32 type, uint32 id) OVERRIDE + void MovementInform(uint32 type, uint32 id) override { ScriptedAI::MovementInform(type, id); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_REACH_WP); @@ -1784,7 +1784,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called before EnterCombat even before the creature is in combat. - void AttackStart(Unit* target) OVERRIDE + void AttackStart(Unit* target) override { ScriptedAI::AttackStart(target); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_PRE_COMBAT); @@ -1799,7 +1799,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called for reaction at stopping attack at no attackers or targets - void EnterEvadeMode() OVERRIDE + void EnterEvadeMode() override { ScriptedAI::EnterEvadeMode(); On_Reset(); @@ -1814,7 +1814,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) - void AttackedBy(Unit* attacker) OVERRIDE + void AttackedBy(Unit* attacker) override { ScriptedAI::AttackedBy(attacker); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_ATTACKED_AT); @@ -1829,7 +1829,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when creature is spawned or respawned (for reseting variables) - void JustRespawned() OVERRIDE + void JustRespawned() override { ScriptedAI::JustRespawned(); On_Reset(); @@ -1844,7 +1844,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called at reaching home after evade - void JustReachedHome() OVERRIDE + void JustReachedHome() override { ScriptedAI::JustReachedHome(); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_REACH_HOME); @@ -1858,7 +1858,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called at text emote receive from player - void ReceiveEmote(Player* player, uint32 emoteId) OVERRIDE + void ReceiveEmote(Player* player, uint32 emoteId) override { ScriptedAI::ReceiveEmote(player, emoteId); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_RECEIVE_EMOTE); @@ -1874,7 +1874,7 @@ struct ElunaCreatureAI : ScriptedAI } // called when the corpse of this creature gets removed - void CorpseRemoved(uint32& respawnDelay) OVERRIDE + void CorpseRemoved(uint32& respawnDelay) override { ScriptedAI::CorpseRemoved(respawnDelay); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_CORPSE_REMOVED); @@ -1890,13 +1890,13 @@ struct ElunaCreatureAI : ScriptedAI #ifdef MANGOS // Enables use of MoveInLineOfSight - bool IsVisible(Unit* who) const OVERRIDE + bool IsVisible(Unit* who) const override { return me->IsWithinLOSInMap(who); } #endif - void MoveInLineOfSight(Unit* who) OVERRIDE + void MoveInLineOfSight(Unit* who) override { ScriptedAI::MoveInLineOfSight(who); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_MOVE_IN_LOS); @@ -1924,7 +1924,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when hit by a spell - void SpellHit(Unit* caster, SpellInfo const* spell) OVERRIDE + void SpellHit(Unit* caster, SpellInfo const* spell) override { ScriptedAI::SpellHit(caster, spell); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_HIT_BY_SPELL); @@ -1940,7 +1940,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when spell hits a target - void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE + void SpellHitTarget(Unit* target, SpellInfo const* spell) override { ScriptedAI::SpellHitTarget(target, spell); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_SPELL_HIT_TARGET); @@ -1958,13 +1958,13 @@ struct ElunaCreatureAI : ScriptedAI #ifndef MANGOS // Called when the creature is summoned successfully by other creature - void IsSummonedBy(Unit* summoner) OVERRIDE + void IsSummonedBy(Unit* summoner) override { ScriptedAI::IsSummonedBy(summoner); sHookMgr->OnSummoned(me, summoner); } - void SummonedCreatureDies(Creature* summon, Unit* killer) OVERRIDE + void SummonedCreatureDies(Creature* summon, Unit* killer) override { ScriptedAI::SummonedCreatureDies(summon, killer); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_SUMMONED_CREATURE_DIED); @@ -1980,7 +1980,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when owner takes damage - void OwnerAttackedBy(Unit* attacker) OVERRIDE + void OwnerAttackedBy(Unit* attacker) override { ScriptedAI::OwnerAttackedBy(attacker); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_OWNER_ATTACKED_AT); @@ -1995,7 +1995,7 @@ struct ElunaCreatureAI : ScriptedAI } // Called when owner attacks something - void OwnerAttacked(Unit* target) OVERRIDE + void OwnerAttacked(Unit* target) override { ScriptedAI::OwnerAttacked(target); int bind = sEluna->CreatureEventBindings.GetBind(me->GetEntry(), CREATURE_EVENT_ON_OWNER_ATTACKED); diff --git a/LuaEngine.h b/LuaEngine.h index 92bb056..d1fb72c 100644 --- a/LuaEngine.h +++ b/LuaEngine.h @@ -96,7 +96,6 @@ typedef std::set ScriptPaths; #define CORE_NAME "MaNGOS" #define SERVER_MSG_STRING SERVER_MSG_CUSTOM #define MAX_LOCALES MAX_LOCALE -#define OVERRIDE override #define DIALOG_STATUS_SCRIPTED_NO_STATUS DIALOG_STATUS_UNDEFINED #define TARGETICONCOUNT TARGET_ICON_COUNT typedef TemporarySummon TempSummon;