diff options
| author | DDuarte <dnpd.dd@gmail.com> | 2014-08-09 20:17:40 +0100 |
|---|---|---|
| committer | DDuarte <dnpd.dd@gmail.com> | 2014-08-09 20:17:40 +0100 |
| commit | a394205eca86d2ea2a8539734df49432189bc73b (patch) | |
| tree | 124f8f2f15bd6961c91d7e042f941d3222ad50e9 /src/server/game/Entities | |
| parent | 272b9d3d16cda66abb951596c87eb655d196e354 (diff) | |
Core/Server: Add missing overrides
Diffstat (limited to 'src/server/game/Entities')
| -rw-r--r-- | src/server/game/Entities/Corpse/Corpse.h | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 76 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/TemporarySummon.h | 40 | ||||
| -rw-r--r-- | src/server/game/Entities/DynamicObject/DynamicObject.h | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/GameObject/GameObject.h | 34 | ||||
| -rw-r--r-- | src/server/game/Entities/Item/Container/Bag.h | 14 | ||||
| -rw-r--r-- | src/server/game/Entities/Item/Item.h | 6 | ||||
| -rw-r--r-- | src/server/game/Entities/Object/Object.h | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Pet/Pet.h | 26 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.h | 74 | ||||
| -rw-r--r-- | src/server/game/Entities/Totem/Totem.h | 24 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 20 | ||||
| -rw-r--r-- | src/server/game/Entities/Vehicle/Vehicle.h | 8 |
13 files changed, 168 insertions, 168 deletions
diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index def84dd93a9..5039c85bcb9 100644 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -52,8 +52,8 @@ class Corpse : public WorldObject, public GridObject<Corpse> explicit Corpse(CorpseType type = CORPSE_BONES); ~Corpse(); - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; bool Create(uint32 guidlow, Map* map); bool Create(uint32 guidlow, Player* owner); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 1154bc17d1f..ea4da5d5611 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -428,11 +428,11 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject explicit Creature(bool isWorldObject = false); virtual ~Creature(); - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; - void SetObjectScale(float scale); - void SetDisplayId(uint32 modelId); + void SetObjectScale(float scale) override; + void SetDisplayId(uint32 modelId) override; void DisappearAndDie(); @@ -443,8 +443,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; } - void Update(uint32 time); // overwrited Unit::Update - void GetRespawnPosition(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const; + void Update(uint32 time) override; // overwrited Unit::Update + void GetRespawnPosition(float &x, float &y, float &z, float* ori = nullptr, float* dist =nullptr) const; void SetCorpseDelay(uint32 delay) { m_corpseDelay = delay; } uint32 GetCorpseDelay() const { return m_corpseDelay; } @@ -454,7 +454,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject bool IsGuard() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_GUARD) != 0; } bool CanWalk() const { return (GetCreatureTemplate()->InhabitType & INHABIT_GROUND) != 0; } bool CanSwim() const { return (GetCreatureTemplate()->InhabitType & INHABIT_WATER) != 0 || IsPet(); } - bool CanFly() const { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; } + bool CanFly() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; } void SetReactState(ReactStates st) { m_reactState = st; } ReactStates GetReactState() { return m_reactState; } @@ -465,14 +465,14 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject bool isCanInteractWithBattleMaster(Player* player, bool msg) const; bool isCanTrainingAndResetTalentsOf(Player* player) const; bool CanCreatureAttack(Unit const* victim, bool force = true) const; - bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // override Unit::IsImmunedToSpell - bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; // override Unit::IsImmunedToSpellEffect + bool IsImmunedToSpell(SpellInfo const* spellInfo) const override; // override Unit::IsImmunedToSpell + bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override; // override Unit::IsImmunedToSpellEffect bool isElite() const; bool isWorldBoss() const; bool IsDungeonBoss() const; - uint8 getLevelForTarget(WorldObject const* target) const; // overwrite Unit::getLevelForTarget for boss level support + uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); } @@ -481,17 +481,17 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject CreatureAI* AI() const { return (CreatureAI*)i_AI; } - bool SetWalk(bool enable); - bool SetDisableGravity(bool disable, bool packetOnly = false); - bool SetSwim(bool enable); - bool SetCanFly(bool enable); - bool SetWaterWalking(bool enable, bool packetOnly = false); - bool SetFeatherFall(bool enable, bool packetOnly = false); - bool SetHover(bool enable, bool packetOnly = false); + bool SetWalk(bool enable) override; + bool SetDisableGravity(bool disable, bool packetOnly = false) override; + bool SetSwim(bool enable) override; + bool SetCanFly(bool enable) override; + bool SetWaterWalking(bool enable, bool packetOnly = false) override; + bool SetFeatherFall(bool enable, bool packetOnly = false) override; + bool SetHover(bool enable, bool packetOnly = false) override; - uint32 GetShieldBlockValue() const; + uint32 GetShieldBlockValue() const override; - SpellSchoolMask GetMeleeDamageSchoolMask() const { return m_meleeDamageSchoolMask; } + SpellSchoolMask GetMeleeDamageSchoolMask() const override { return m_meleeDamageSchoolMask; } void SetMeleeDamageSchool(SpellSchools school) { m_meleeDamageSchoolMask = SpellSchoolMask(1 << school); } void _AddCreatureSpellCooldown(uint32 spell_id, time_t end_time); @@ -500,21 +500,21 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject bool HasSpellCooldown(uint32 spell_id) const; bool HasCategoryCooldown(uint32 spell_id) const; uint32 GetCreatureSpellCooldownDelay(uint32 spellId) const; - virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs); + virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) override; - bool HasSpell(uint32 spellID) const; + bool HasSpell(uint32 spellID) const override; bool UpdateEntry(uint32 entry, CreatureData const* data = nullptr); void UpdateMovementFlags(); - bool UpdateStats(Stats stat); - bool UpdateAllStats(); - void UpdateResistances(uint32 school); - void UpdateArmor(); - void UpdateMaxHealth(); - void UpdateMaxPower(Powers power); - void UpdateAttackPowerAndDamage(bool ranged = false); + bool UpdateStats(Stats stat) override; + bool UpdateAllStats() override; + void UpdateResistances(uint32 school) override; + void UpdateArmor() override; + void UpdateMaxHealth() override; + void UpdateMaxPower(Powers power) override; + void UpdateAttackPowerAndDamage(bool ranged = false) override; void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float& minDamage, float& maxDamage) override; void SetCanDualWield(bool value) override; @@ -539,9 +539,9 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject uint32 GetScriptId() const; // override WorldObject function for proper name localization - std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const; + std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const override; - void setDeathState(DeathState s); // override virtual Unit::setDeathState + void setDeathState(DeathState s) override; // override virtual Unit::setDeathState bool LoadFromDB(uint32 guid, Map* map) { return LoadCreatureFromDB(guid, map, false); } bool LoadCreatureFromDB(uint32 guid, Map* map, bool addToMap = true); @@ -609,7 +609,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject time_t GetRespawnTimeEx() const; void SetRespawnTime(uint32 respawn) { m_respawnTime = respawn ? time(NULL) + respawn : 0; } void Respawn(bool force = false); - void SaveRespawnTime(); + void SaveRespawnTime() override; uint32 GetRespawnDelay() const { return m_respawnDelay; } void SetRespawnDelay(uint32 delay) { m_respawnDelay = delay; } @@ -624,8 +624,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject void SetInCombatWithZone(); - bool hasQuest(uint32 quest_id) const; - bool hasInvolvedQuest(uint32 quest_id) const; + bool hasQuest(uint32 quest_id) const override; + bool hasInvolvedQuest(uint32 quest_id) const override; bool isRegeneratingHealth() { return m_regenHealth; } void setRegeneratingHealth(bool regenHealth) { m_regenHealth = regenHealth; } @@ -676,7 +676,7 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject bool m_isTempWorldObject; //true when possessed // Handling caster facing during spellcast - void SetTarget(uint64 guid); + void SetTarget(uint64 guid) override; void FocusTarget(Spell const* focusSpell, WorldObject const* target); void ReleaseFocus(Spell const* focusSpell); @@ -728,8 +728,8 @@ class Creature : public Unit, public GridObject<Creature>, public MapObject uint16 m_LootMode; // Bitmask (default: LOOT_MODE_DEFAULT) that determines what loot will be lootable - bool IsInvisibleDueToDespawn() const; - bool CanAlwaysSee(WorldObject const* obj) const; + bool IsInvisibleDueToDespawn() const override; + bool CanAlwaysSee(WorldObject const* obj) const override; private: void ForcedDespawn(uint32 timeMSToDespawn = 0); @@ -750,7 +750,7 @@ class AssistDelayEvent : public BasicEvent public: AssistDelayEvent(uint64 victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { } - bool Execute(uint64 e_time, uint32 p_time); + bool Execute(uint64 e_time, uint32 p_time) override; void AddAssistant(uint64 guid) { m_assistants.push_back(guid); } private: AssistDelayEvent(); @@ -764,7 +764,7 @@ class ForcedDespawnDelayEvent : public BasicEvent { public: ForcedDespawnDelayEvent(Creature& owner) : BasicEvent(), m_owner(owner) { } - bool Execute(uint64 e_time, uint32 p_time); + bool Execute(uint64 e_time, uint32 p_time) override; private: Creature& m_owner; diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 1cee6361172..58cc6eb7d0b 100644 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -42,13 +42,13 @@ class TempSummon : public Creature public: explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); virtual ~TempSummon() { } - void Update(uint32 time); + void Update(uint32 time) override; virtual void InitStats(uint32 lifetime); virtual void InitSummon(); virtual void UnSummon(uint32 msTime = 0); - void RemoveFromWorld(); + void RemoveFromWorld() override; void SetTempSummonType(TempSummonType type); - void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) { } + void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) override { } Unit* GetSummoner() const; Creature* GetSummonerCreatureBase() const; uint64 GetSummonerGUID() const { return m_summonerGUID; } @@ -67,10 +67,10 @@ class Minion : public TempSummon { public: Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); - void InitStats(uint32 duration); - void RemoveFromWorld(); + void InitStats(uint32 duration) override; + void RemoveFromWorld() override; Unit* GetOwner() const { return m_owner; } - float GetFollowAngle() const { return m_followAngle; } + float GetFollowAngle() const override { return m_followAngle; } void SetFollowAngle(float angle) { m_followAngle = angle; } bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet bool IsSpiritWolf() const {return GetEntry() == 29264;} // Spirit wolf from feral spirits @@ -84,17 +84,17 @@ class Guardian : public Minion { public: Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject); - void InitStats(uint32 duration); + void InitStats(uint32 duration) override; bool InitStatsForLevel(uint8 level); - void InitSummon(); + void InitSummon() override; - bool UpdateStats(Stats stat); - bool UpdateAllStats(); - void UpdateResistances(uint32 school); - void UpdateArmor(); - void UpdateMaxHealth(); - void UpdateMaxPower(Powers power); - void UpdateAttackPowerAndDamage(bool ranged = false); + bool UpdateStats(Stats stat) override; + bool UpdateAllStats() override; + void UpdateResistances(uint32 school) override; + void UpdateArmor() override; + void UpdateMaxHealth() override; + void UpdateMaxPower(Powers power) override; + void UpdateAttackPowerAndDamage(bool ranged = false) override; void UpdateDamagePhysical(WeaponAttackType attType) override; int32 GetBonusDamage() const { return m_bonusSpellDamage; } @@ -108,17 +108,17 @@ class Puppet : public Minion { public: Puppet(SummonPropertiesEntry const* properties, Unit* owner); - void InitStats(uint32 duration); - void InitSummon(); - void Update(uint32 time); - void RemoveFromWorld(); + void InitStats(uint32 duration) override; + void InitSummon() override; + void Update(uint32 time) override; + void RemoveFromWorld() override; }; class ForcedUnsummonDelayEvent : public BasicEvent { public: ForcedUnsummonDelayEvent(TempSummon& owner) : BasicEvent(), m_owner(owner) { } - bool Execute(uint64 e_time, uint32 p_time); + bool Execute(uint64 e_time, uint32 p_time) override; private: TempSummon& m_owner; diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index c9fd1d29f8b..7816600b7a4 100644 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -38,11 +38,11 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>, publ DynamicObject(bool isWorldObject); ~DynamicObject(); - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; bool CreateDynamicObject(uint32 guidlow, Unit* caster, uint32 spellId, Position const& pos, float radius, DynamicObjectType type); - void Update(uint32 p_time); + void Update(uint32 p_time) override; void Remove(); void SetDuration(int32 newDuration); int32 GetDuration() const; diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index f5074e202e9..f551ab2046c 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -635,14 +635,14 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map explicit GameObject(); ~GameObject(); - void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const; + void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override; - void AddToWorld(); - void RemoveFromWorld(); - void CleanupsBeforeDelete(bool finalCleanup = true); + void AddToWorld() override; + void RemoveFromWorld() override; + void CleanupsBeforeDelete(bool finalCleanup = true) override; bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0); - void Update(uint32 p_time); + void Update(uint32 p_time) override; static GameObject* GetGameObject(WorldObject& object, uint64 guid); GameObjectTemplate const* GetGOInfo() const { return m_goInfo; } GameObjectData const* GetGOData() const { return m_goData; } @@ -657,7 +657,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f); // overwrite WorldObject function for proper name localization - std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const; + std::string const& GetNameForLocaleIdx(LocaleConstant locale_idx) const override; void SaveToDB(); void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask); @@ -757,7 +757,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map uint32 GetUseCount() const { return m_usetimes; } uint32 GetUniqueUseCount() const { return m_unique_users.size(); } - void SaveRespawnTime(); + void SaveRespawnTime() override; Loot loot; @@ -769,8 +769,8 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map uint32 m_groupLootTimer; // (msecs)timer used for group loot uint32 lootingGroupLowGUID; // used to find group which is looting - bool hasQuest(uint32 quest_id) const; - bool hasInvolvedQuest(uint32 quest_id) const; + bool hasQuest(uint32 quest_id) const override; + bool hasInvolvedQuest(uint32 quest_id) const override; bool ActivateToQuest(Player* target) const; void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false, Unit* user = NULL); // 0 = use `gameobject`.`spawntimesecs` @@ -780,10 +780,10 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map bool IsNeverVisible() const override; - bool IsAlwaysVisibleFor(WorldObject const* seer) const; - bool IsInvisibleDueToDespawn() const; + bool IsAlwaysVisibleFor(WorldObject const* seer) const override; + bool IsInvisibleDueToDespawn() const override; - uint8 getLevelForTarget(WorldObject const* target) const + uint8 getLevelForTarget(WorldObject const* target) const override { if (Unit* owner = GetOwner()) return owner->getLevelForTarget(target); @@ -828,10 +828,10 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map Transport* ToTransport() { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<Transport*>(this); else return NULL; } Transport const* ToTransport() const { if (GetGOInfo()->type == GAMEOBJECT_TYPE_MO_TRANSPORT) return reinterpret_cast<Transport const*>(this); else return NULL; } - float GetStationaryX() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); } - float GetStationaryY() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); } - float GetStationaryZ() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); } - float GetStationaryO() const { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); } + float GetStationaryX() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionX(); return GetPositionX(); } + float GetStationaryY() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionY(); return GetPositionY(); } + float GetStationaryZ() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetPositionZ(); return GetPositionZ(); } + float GetStationaryO() const override { if (GetGOInfo()->type != GAMEOBJECT_TYPE_MO_TRANSPORT) return m_stationaryPosition.GetOrientation(); return GetOrientation(); } float GetInteractionDistance(); @@ -873,7 +873,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map void SwitchDoorOrButton(bool activate, bool alternative = false); //! Object distance/size - overridden from Object::_IsWithinDist. Needs to take in account proper GO size. - bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/) const + bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool /*is3D*/) const override { //! Following check does check 3d distance return IsInRange(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), dist2compare); diff --git a/src/server/game/Entities/Item/Container/Bag.h b/src/server/game/Entities/Item/Container/Bag.h index 1e39e5a41ad..db0c8edf556 100644 --- a/src/server/game/Entities/Item/Container/Bag.h +++ b/src/server/game/Entities/Item/Container/Bag.h @@ -32,10 +32,10 @@ class Bag : public Item Bag(); ~Bag(); - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; - bool Create(uint32 guidlow, uint32 itemid, Player const* owner); + bool Create(uint32 guidlow, uint32 itemid, Player const* owner) override; void Clear(); void StoreItem(uint8 slot, Item* pItem, bool update); @@ -52,13 +52,13 @@ class Bag : public Item // DB operations // overwrite virtual Item::SaveToDB - void SaveToDB(SQLTransaction& trans); + void SaveToDB(SQLTransaction& trans) override; // overwrite virtual Item::LoadFromDB - bool LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entry); + bool LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entry) override; // overwrite virtual Item::DeleteFromDB - void DeleteFromDB(SQLTransaction& trans); + void DeleteFromDB(SQLTransaction& trans) override; - void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const; + void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override; protected: diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index a65579cc134..32fbe9e35fd 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -324,8 +324,8 @@ class Item : public Object uState = state; } - bool hasQuest(uint32 quest_id) const { return GetTemplate()->StartQuest == quest_id; } - bool hasInvolvedQuest(uint32 /*quest_id*/) const { return false; } + bool hasQuest(uint32 quest_id) const override { return GetTemplate()->StartQuest == quest_id; } + bool hasInvolvedQuest(uint32 /*quest_id*/) const override { return false; } bool IsPotion() const { return GetTemplate()->IsPotion(); } bool IsWeaponVellum() const { return GetTemplate()->IsWeaponVellum(); } bool IsArmorVellum() const { return GetTemplate()->IsArmorVellum(); } @@ -350,7 +350,7 @@ class Item : public Object void ClearSoulboundTradeable(Player* currentOwner); bool CheckSoulboundTradeExpire(); - void BuildUpdate(UpdateDataMapType&); + void BuildUpdate(UpdateDataMapType&) override; uint32 GetScriptId() const { return GetTemplate()->ScriptId; } private: diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index b82ca1cb0b2..dc6007cbfe0 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -580,7 +580,7 @@ class WorldObject : public Object, public WorldLocation virtual void Update (uint32 /*time_diff*/) { } void _Create(uint32 guidlow, HighGuid guidhigh, uint32 phaseMask); - virtual void RemoveFromWorld(); + virtual void RemoveFromWorld() override; void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const; void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const; @@ -713,7 +713,7 @@ class WorldObject : public Object, public WorldLocation void DestroyForNearbyPlayers(); virtual void UpdateObjectVisibility(bool forced = true); - void BuildUpdate(UpdateDataMapType&); + void BuildUpdate(UpdateDataMapType&) override; //relocation and visibility system functions void AddToNotify(uint16 f) { m_notifyflags |= f;} diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 68465f6b8e7..7d4523be9af 100644 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -43,10 +43,10 @@ class Pet : public Guardian explicit Pet(Player* owner, PetType type = MAX_PET_TYPE); virtual ~Pet(); - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; - void SetDisplayId(uint32 modelId); + void SetDisplayId(uint32 modelId) override; PetType getPetType() const { return m_petType; } void setPetType(PetType type) { m_petType = type; } @@ -60,16 +60,16 @@ class Pet : public Guardian bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner); bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask); bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false); - bool isBeingLoaded() const { return m_loading;} + bool isBeingLoaded() const override { return m_loading;} void SavePetToDB(PetSaveMode mode); void Remove(PetSaveMode mode, bool returnreagent = false); static void DeleteFromDB(uint32 guidlow); - void setDeathState(DeathState s); // overwrite virtual Creature::setDeathState and Unit::setDeathState - void Update(uint32 diff); // overwrite virtual Creature::Update and Unit::Update + void setDeathState(DeathState s) override; // overwrite virtual Creature::setDeathState and Unit::setDeathState + void Update(uint32 diff) override; // overwrite virtual Creature::Update and Unit::Update - uint8 GetPetAutoSpellSize() const { return m_autospells.size(); } - uint32 GetPetAutoSpellOnPos(uint8 pos) const + uint8 GetPetAutoSpellSize() const override { return m_autospells.size(); } + uint32 GetPetAutoSpellOnPos(uint8 pos) const override { if (pos >= m_autospells.size()) return 0; @@ -100,7 +100,7 @@ class Pet : public Guardian void ToggleAutocast(SpellInfo const* spellInfo, bool apply); - bool HasSpell(uint32 spell) const; + bool HasSpell(uint32 spell) const override; void LearnPetPassives(); void CastPetAuras(bool current); @@ -121,7 +121,7 @@ class Pet : public Guardian bool unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true); bool removeSpell(uint32 spell_id, bool learn_prev, bool clear_ab = true); void CleanupActionBar(); - virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs); + virtual void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) override; PetSpellMap m_spells; AutoSpellList m_autospells; @@ -129,7 +129,7 @@ class Pet : public Guardian void InitPetCreateSpells(); bool resetTalents(); - static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = NULL); + static void resetTalentsForAllPetsOf(Player* owner, Pet* online_pet = nullptr); void InitTalentForLevel(); uint8 GetMaxTalentPointsForLevel(uint8 level); @@ -159,11 +159,11 @@ class Pet : public Guardian DeclinedName *m_declinedname; private: - void SaveToDB(uint32, uint8, uint32) // override of Creature::SaveToDB - must not be called + void SaveToDB(uint32, uint8, uint32) override // override of Creature::SaveToDB - must not be called { ASSERT(false); } - void DeleteFromDB() // override of Creature::DeleteFromDB - must not be called + void DeleteFromDB() override // override of Creature::DeleteFromDB - must not be called { ASSERT(false); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 508be730a18..c8d5b270ede 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1101,12 +1101,12 @@ class Player : public Unit, public GridObject<Player> explicit Player(WorldSession* session); ~Player(); - void CleanupsBeforeDelete(bool finalCleanup = true); + void CleanupsBeforeDelete(bool finalCleanup = true) override; - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; - void SetObjectScale(float scale) + void SetObjectScale(float scale) override { Unit::SetObjectScale(scale); SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, scale * DEFAULT_WORLD_OBJECT_SIZE); @@ -1122,14 +1122,14 @@ class Player : public Unit, public GridObject<Player> bool Create(uint32 guidlow, CharacterCreateInfo* createInfo); - void Update(uint32 time); + void Update(uint32 time) override; static bool BuildEnumData(PreparedQueryResult result, WorldPacket* data); void SetInWater(bool apply); - bool IsInWater() const { return m_isInWater; } - bool IsUnderWater() const; + bool IsInWater() const override { return m_isInWater; } + bool IsUnderWater() const override; bool IsFalling() { return GetPositionZ() < m_lastFallZ; } void SendInitialPacketsBeforeAddToMap(); @@ -1191,7 +1191,7 @@ class Player : public Unit, public GridObject<Player> uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; } uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; } - void setDeathState(DeathState s); // overwrite Unit::setDeathState + void setDeathState(DeathState s) override; // overwrite Unit::setDeathState void InnEnter(time_t time, uint32 mapid, float x, float y, float z); @@ -1228,7 +1228,7 @@ class Player : public Unit, public GridObject<Player> /*********************************************************/ void SetVirtualItemSlot(uint8 i, Item* item); - void SetSheath(SheathState sheathed); // overwrite Unit version + void SetSheath(SheathState sheathed) override; // overwrite Unit version uint8 FindEquipSlot(ItemTemplate const* proto, uint32 slot, bool swap) const; uint32 GetItemCount(uint32 item, bool inBankAlso = false, Item* skipItem = NULL) const; uint32 GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem = NULL) const; @@ -1671,7 +1671,7 @@ class Player : public Unit, public GridObject<Player> void AddSpellCooldown(uint32 spell_id, uint32 itemid, time_t end_time); void ModifySpellCooldown(uint32 spellId, int32 cooldown); void SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId = 0, Spell* spell = NULL, bool setCooldown = true); - void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs); + void ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) override; void RemoveSpellCooldown(uint32 spell_id, bool update = false); void RemoveSpellCategoryCooldown(uint32 cat, bool update = false); void SendClearCooldown(uint32 spell_id, Unit* target); @@ -1779,15 +1779,15 @@ class Player : public Unit, public GridObject<Player> float GetHealthBonusFromStamina(); float GetManaBonusFromIntellect(); - bool UpdateStats(Stats stat); - bool UpdateAllStats(); + bool UpdateStats(Stats stat) override; + bool UpdateAllStats() override; void ApplySpellPenetrationBonus(int32 amount, bool apply); - void UpdateResistances(uint32 school); - void UpdateArmor(); - void UpdateMaxHealth(); - void UpdateMaxPower(Powers power); + void UpdateResistances(uint32 school) override; + void UpdateArmor() override; + void UpdateMaxHealth() override; + void UpdateMaxPower(Powers power) override; void ApplyFeralAPBonus(int32 amount, bool apply); - void UpdateAttackPowerAndDamage(bool ranged = false); + void UpdateAttackPowerAndDamage(bool ranged = false) override; void UpdateShieldBlockValue(); void ApplySpellPowerBonus(int32 amount, bool apply); void UpdateSpellDamageAndHealingBonus(); @@ -1836,8 +1836,8 @@ class Player : public Unit, public GridObject<Player> WorldSession* GetSession() const { return m_session; } - void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const; - void DestroyForPlayer(Player* target, bool onDeath = false) const; + void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const override; + void DestroyForPlayer(Player* target, bool onDeath = false) const override; void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f); // notifiers @@ -1856,14 +1856,14 @@ class Player : public Unit, public GridObject<Player> void SendResetInstanceFailed(uint32 reason, uint32 MapId); void SendResetFailedNotify(uint32 mapid); - virtual bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false); + virtual bool UpdatePosition(float x, float y, float z, float orientation, bool teleport = false) override; bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } - void UpdateUnderwaterState(Map* m, float x, float y, float z); + void UpdateUnderwaterState(Map* m, float x, float y, float z) override; - void SendMessageToSet(WorldPacket* data, bool self) {SendMessageToSetInRange(data, GetVisibilityRange(), self); };// overwrite Object::SendMessageToSet - void SendMessageToSetInRange(WorldPacket* data, float fist, bool self);// overwrite Object::SendMessageToSetInRange + void SendMessageToSet(WorldPacket* data, bool self) override {SendMessageToSetInRange(data, GetVisibilityRange(), self); };// overwrite Object::SendMessageToSet + void SendMessageToSetInRange(WorldPacket* data, float fist, bool self) override;// overwrite Object::SendMessageToSetInRange void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool own_team_only); - void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr); + void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr) override; void SendTeleportAckPacket(); @@ -1980,7 +1980,7 @@ class Player : public Unit, public GridObject<Player> int32 CalculateCorpseReclaimDelay(bool load = false); void SendCorpseReclaimDelay(uint32 delay); - uint32 GetShieldBlockValue() const; // overwrite Unit version (virtual) + uint32 GetShieldBlockValue() const override; // overwrite Unit version (virtual) bool CanParry() const { return m_canParry; } void SetCanParry(bool value); bool CanBlock() const { return m_canBlock; } @@ -2169,12 +2169,12 @@ class Player : public Unit, public GridObject<Player> bool HaveAtClient(WorldObject const* u) const; - bool IsNeverVisible() const; + bool IsNeverVisible() const override; bool IsVisibleGloballyFor(Player const* player) const; void SendInitialVisiblePackets(Unit* target); - void UpdateObjectVisibility(bool forced = true); + void UpdateObjectVisibility(bool forced = true) override; void UpdateVisibilityForPlayer(); void UpdateVisibilityOf(WorldObject* target); void UpdateTriggerVisibility(); @@ -2269,8 +2269,8 @@ class Player : public Unit, public GridObject<Player> MapReference &GetMapRef() { return m_mapRef; } // Set map to player and add reference - void SetMap(Map* map); - void ResetMap(); + void SetMap(Map* map) override; + void ResetMap() override; bool isAllowedToLoot(const Creature* creature); @@ -2324,13 +2324,13 @@ class Player : public Unit, public GridObject<Player> bool IsInWhisperWhiteList(uint64 guid); void RemoveFromWhisperWhiteList(uint64 guid) { WhisperList.remove(guid); } - bool SetDisableGravity(bool disable, bool packetOnly /* = false */); - bool SetCanFly(bool apply); - bool SetWaterWalking(bool apply, bool packetOnly = false); - bool SetFeatherFall(bool apply, bool packetOnly = false); - bool SetHover(bool enable, bool packetOnly = false); + bool SetDisableGravity(bool disable, bool packetOnly /* = false */) override; + bool SetCanFly(bool apply) override; + bool SetWaterWalking(bool apply, bool packetOnly = false) override; + bool SetFeatherFall(bool apply, bool packetOnly = false) override; + bool SetHover(bool enable, bool packetOnly = false) override; - bool CanFly() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } + bool CanFly() const override { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_CAN_FLY); } //! Return collision height sent to client float GetCollisionHeight(bool mounted) const; @@ -2594,9 +2594,9 @@ class Player : public Unit, public GridObject<Player> Runes *m_runes; EquipmentSets m_EquipmentSets; - bool CanAlwaysSee(WorldObject const* obj) const; + bool CanAlwaysSee(WorldObject const* obj) const override; - bool IsAlwaysDetectableFor(WorldObject const* seer) const; + bool IsAlwaysDetectableFor(WorldObject const* seer) const override; uint8 m_grantableLevels; diff --git a/src/server/game/Entities/Totem/Totem.h b/src/server/game/Entities/Totem/Totem.h index da0398f3a96..534e818842e 100644 --- a/src/server/game/Entities/Totem/Totem.h +++ b/src/server/game/Entities/Totem/Totem.h @@ -37,25 +37,25 @@ class Totem : public Minion public: Totem(SummonPropertiesEntry const* properties, Unit* owner); virtual ~Totem() { } - void Update(uint32 time); - void InitStats(uint32 duration); - void InitSummon(); - void UnSummon(uint32 msTime = 0); + void Update(uint32 time) override; + void InitStats(uint32 duration) override; + void InitSummon() override; + void UnSummon(uint32 msTime = 0) override; uint32 GetSpell(uint8 slot = 0) const { return m_spells[slot]; } uint32 GetTotemDuration() const { return m_duration; } void SetTotemDuration(uint32 duration) { m_duration = duration; } TotemType GetTotemType() const { return m_type; } - bool UpdateStats(Stats /*stat*/) { return true; } - bool UpdateAllStats() { return true; } - void UpdateResistances(uint32 /*school*/) { } - void UpdateArmor() { } - void UpdateMaxHealth() { } - void UpdateMaxPower(Powers /*power*/) { } - void UpdateAttackPowerAndDamage(bool /*ranged*/) { } + bool UpdateStats(Stats /*stat*/) override { return true; } + bool UpdateAllStats() override { return true; } + void UpdateResistances(uint32 /*school*/) override { } + void UpdateArmor() override { } + void UpdateMaxHealth() override { } + void UpdateMaxPower(Powers /*power*/) override { } + void UpdateAttackPowerAndDamage(bool /*ranged*/) override { } void UpdateDamagePhysical(WeaponAttackType /*attType*/) override { } - bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const; + bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const override; protected: TotemType m_type; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index b88ea856c77..b65081ba89e 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1284,8 +1284,8 @@ class Unit : public WorldObject UnitAI* GetAI() { return i_AI; } void SetAI(UnitAI* newAI) { i_AI = newAI; } - void AddToWorld(); - void RemoveFromWorld(); + void AddToWorld() override; + void RemoveFromWorld() override; void CleanupBeforeRemoveFromMap(bool finalCleanup); void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units) @@ -1300,7 +1300,7 @@ class Unit : public WorldObject float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; float GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; - virtual void Update(uint32 time); + virtual void Update(uint32 time) override; void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; } void resetAttackTimer(WeaponAttackType type = BASE_ATTACK); @@ -1356,7 +1356,7 @@ class Unit : public WorldObject bool IsVehicle() const { return (m_unitTypeMask & UNIT_MASK_VEHICLE) != 0; } uint8 getLevel() const { return uint8(GetUInt32Value(UNIT_FIELD_LEVEL)); } - uint8 getLevelForTarget(WorldObject const* /*target*/) const { return getLevel(); } + uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); } void SetLevel(uint8 lvl); uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, 0); } uint32 getRaceMask() const { return 1 << (getRace()-1); } @@ -1916,8 +1916,8 @@ class Unit : public WorldObject void SetVisible(bool x); // common function for visibility checks for player/creatures with detection code - void SetPhaseMask(uint32 newPhaseMask, bool update);// overwrite WorldObject::SetPhaseMask - void UpdateObjectVisibility(bool forced = true); + void SetPhaseMask(uint32 newPhaseMask, bool update) override;// overwrite WorldObject::SetPhaseMask + void UpdateObjectVisibility(bool forced = true) override; SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]; uint32 m_lastSanctuaryTime; @@ -2104,7 +2104,7 @@ class Unit : public WorldObject bool IsOnVehicle(const Unit* vehicle) const; Unit* GetVehicleBase() const; Creature* GetVehicleCreatureBase() const; - uint64 GetTransGUID() const; + uint64 GetTransGUID() const override; /// Returns the transport this unit is on directly (if on vehicle and transport, return vehicle) TransportBase* GetDirectTransport() const; @@ -2160,7 +2160,7 @@ class Unit : public WorldObject protected: explicit Unit (bool isWorldObject); - void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const; + void BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, Player* target) const override; UnitAI* i_AI, *i_disabledAI; @@ -2229,8 +2229,8 @@ class Unit : public WorldObject uint32 m_unitTypeMask; LiquidTypeEntry const* _lastLiquid; - bool IsAlwaysVisibleFor(WorldObject const* seer) const; - bool IsAlwaysDetectableFor(WorldObject const* seer) const; + bool IsAlwaysVisibleFor(WorldObject const* seer) const override; + bool IsAlwaysDetectableFor(WorldObject const* seer) const override; void DisableSpline(); private: diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 36119fa0027..be008330f0c 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -89,7 +89,7 @@ class Vehicle : public TransportBase void InitMovementInfoForBase(); /// This method transforms supplied transport offsets into global coordinates - void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const + void CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const override { TransportBase::CalculatePassengerPosition(x, y, z, o, GetBase()->GetPositionX(), GetBase()->GetPositionY(), @@ -97,7 +97,7 @@ class Vehicle : public TransportBase } /// This method transforms supplied global coordinates into local offsets - void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const + void CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const override { TransportBase::CalculatePassengerOffset(x, y, z, o, GetBase()->GetPositionX(), GetBase()->GetPositionY(), @@ -126,8 +126,8 @@ class VehicleJoinEvent : public BasicEvent protected: VehicleJoinEvent(Vehicle* v, Unit* u) : Target(v), Passenger(u), Seat(Target->Seats.end()) { } ~VehicleJoinEvent(); - bool Execute(uint64, uint32); - void Abort(uint64); + bool Execute(uint64, uint32) override; + void Abort(uint64) override; Vehicle* Target; Unit* Passenger; |
