fix(CORE): Missing override on various functions (#2602)

This commit is contained in:
Nefertumm
2020-01-21 19:03:15 -03:00
committed by GitHub
parent b66ec5712e
commit 59234f8f4b
16 changed files with 193 additions and 166 deletions

View File

@@ -584,7 +584,7 @@ enum UnitFlags
UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8
UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3
UNIT_FLAG_SILENCED = 0x00002000, // silenced, 2.1.1
UNIT_FLAG_UNK_14 = 0x00004000, // 2.0.8
UNIT_FLAG_CANNOT_SWIM = 0x00004000, // 2.0.8
UNIT_FLAG_UNK_15 = 0x00008000,
UNIT_FLAG_UNK_16 = 0x00010000,
UNIT_FLAG_PACIFIED = 0x00020000, // 3.0.3 ok
@@ -1370,11 +1370,11 @@ 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); // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units)
DiminishingLevels GetDiminishing(DiminishingGroup group);
void IncrDiminishing(DiminishingGroup group);
@@ -1386,7 +1386,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, int32 time) { m_attackTimer[type] = time; }
void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);
@@ -1395,7 +1395,7 @@ class Unit : public WorldObject
bool haveOffhandWeapon() const;
bool CanDualWield() const { return m_canDualWield; }
virtual void SetCanDualWield(bool value) { m_canDualWield = value; }
float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
float GetCombatReach() const override { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
float GetMeleeReach() const { float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; }
bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
bool IsWithinMeleeRange(const Unit* obj, float dist = MELEE_RANGE) const;
@@ -1458,7 +1458,7 @@ class Unit : public WorldObject
bool IsVehicle() const { return m_unitTypeMask & UNIT_MASK_VEHICLE; }
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, bool showLevelChange = true);
uint8 getRace(bool original = false) const;
void setRace(uint8 race);
@@ -2128,8 +2128,8 @@ class Unit : public WorldObject
// common function for visibility checks for player/creatures with detection code
uint32 GetPhaseByAuras() const;
void SetPhaseMask(uint32 newPhaseMask, bool update);// overwrite WorldObject::SetPhaseMask
void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false);
void SetPhaseMask(uint32 newPhaseMask, bool update) override;// overwrite WorldObject::SetPhaseMask
void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false) override;
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
uint32 m_lastSanctuaryTime;
@@ -2335,7 +2335,7 @@ class Unit : public WorldObject
bool IsOnVehicle(const Unit* vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
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;
@@ -2354,11 +2354,13 @@ class Unit : public WorldObject
void BuildMovementPacket(ByteBuffer *data) const;
virtual bool CanSwim() const;
bool isMoving() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_MOVING); }
bool isTurning() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_MASK_TURNING); }
virtual bool CanFly() const = 0;
bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); }
bool IsHovering() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_HOVER); }
bool isSwimming() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_SWIMMING); }
virtual bool CanFly() const = 0;
bool IsFlying() const { return m_movementInfo.HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_DISABLE_GRAVITY); }
bool IsFalling() const;
float GetHoverHeight() const { return IsHovering() ? GetFloatValue(UNIT_FIELD_HOVERHEIGHT) : 0.0f; }
@@ -2409,9 +2411,9 @@ class Unit : public WorldObject
bool m_last_outdoors_status;
bool IsOutdoors() const;
uint32 GetZoneId(bool forceRecalc = false) const;
uint32 GetAreaId(bool forceRecalc = false) const;
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, bool forceRecalc = false) const;
uint32 GetZoneId(bool forceRecalc = false) const override;
uint32 GetAreaId(bool forceRecalc = false) const override;
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, bool forceRecalc = false) const override;
// cooldowns
virtual bool HasSpellCooldown(uint32 /*spell_id*/) const { return false; }
@@ -2440,7 +2442,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;
@@ -2515,8 +2517,8 @@ class Unit : public WorldObject
// xinef: apply resilience
bool m_applyResilience;
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;
bool _instantCast;
private: