mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[11588] Use override specifier on Update() methods
Note: override is new keyword in C++11 but VC++ already have override keyword with same behaviour long time. GCC support explicit overrides starting at 4.7. Added workaround for GCC versions < 4.7.
This commit is contained in:
parent
108a167c46
commit
f45e9ad680
12 changed files with 18 additions and 11 deletions
|
|
@ -119,6 +119,12 @@ typedef uint16 WORD;
|
|||
typedef uint32 DWORD;
|
||||
#endif //COMPILER
|
||||
|
||||
#if COMPILER == COMPILER_GNU
|
||||
# if !defined(__GXX_EXPERIMENTAL_CXX0X__) || (__GNUC__ < 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ < 7)
|
||||
# define override
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef uint64 OBJECT_HANDLE;
|
||||
|
||||
#endif //MANGOS_DEFINE_H
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ class MANGOS_DLL_SPEC Creature : public Unit
|
|||
|
||||
char const* GetSubName() const { return GetCreatureInfo()->SubName; }
|
||||
|
||||
void Update(uint32 update_diff, uint32 time); // overwrite Unit::Update
|
||||
void Update(uint32 update_diff, uint32 time) override; // overwrite Unit::Update
|
||||
|
||||
virtual void RegenerateAll(uint32 update_diff);
|
||||
void GetRespawnCoord(float &x, float &y, float &z, float* ori = NULL, float* dist =NULL) const;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class DynamicObject : public WorldObject
|
|||
void RemoveFromWorld();
|
||||
|
||||
bool Create(uint32 guidlow, Unit *caster, uint32 spellId, SpellEffectIndex effIndex, float x, float y, float z, int32 duration, float radius, DynamicObjectType type);
|
||||
void Update(uint32 update_diff, uint32 p_time);
|
||||
void Update(uint32 update_diff, uint32 p_time) override;
|
||||
void Delete();
|
||||
uint32 GetSpellId() const { return m_spellId; }
|
||||
SpellEffectIndex GetEffIndex() const { return m_effIndex; }
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject
|
|||
void RemoveFromWorld();
|
||||
|
||||
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, uint8 animprogress, GOState go_state);
|
||||
void Update(uint32 update_diff, uint32 p_time);
|
||||
void Update(uint32 update_diff, uint32 p_time) override;
|
||||
GameObjectInfo const* GetGOInfo() const;
|
||||
|
||||
bool IsTransport() const;
|
||||
|
|
|
|||
|
|
@ -432,7 +432,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object
|
|||
|
||||
virtual ~WorldObject ( ) {}
|
||||
|
||||
virtual void Update ( uint32 /*update_diff*/, uint32 /*time_diff*/ ) {}
|
||||
virtual void Update(uint32 /*update_diff*/, uint32 /*time_diff*/) {}
|
||||
|
||||
void _Create( uint32 guidlow, HighGuid guidhigh, uint32 phaseMask);
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class Pet : public Creature
|
|||
static void DeleteFromDB(uint32 guidlow, bool separate_transaction = true);
|
||||
|
||||
void SetDeathState(DeathState s); // overwrite virtual Creature::SetDeathState and Unit::SetDeathState
|
||||
void Update(uint32 update_diff, uint32 diff); // overwrite virtual Creature::Update and Unit::Update
|
||||
void Update(uint32 update_diff, uint32 diff) override; // overwrite virtual Creature::Update and Unit::Update
|
||||
|
||||
uint8 GetPetAutoSpellSize() const { return m_autospells.size(); }
|
||||
uint32 GetPetAutoSpellOnPos(uint8 pos) const
|
||||
|
|
|
|||
|
|
@ -1065,7 +1065,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
|
||||
bool Create( uint32 guidlow, const std::string& name, uint8 race, uint8 class_, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair, uint8 outfitId );
|
||||
|
||||
void Update( uint32 update_diff, uint32 time );
|
||||
void Update(uint32 update_diff, uint32 time) override;
|
||||
|
||||
static bool BuildEnumData( QueryResult * result, WorldPacket * p_data );
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ class TemporarySummon : public Creature
|
|||
public:
|
||||
explicit TemporarySummon(ObjectGuid summoner = ObjectGuid());
|
||||
virtual ~TemporarySummon(){};
|
||||
void Update(uint32 update_diff, uint32 time);
|
||||
|
||||
void Update(uint32 update_diff, uint32 time) override;
|
||||
void Summon(TempSummonType type, uint32 lifetime);
|
||||
void MANGOS_DLL_SPEC UnSummon();
|
||||
void SaveToDB();
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Totem : public Creature
|
|||
explicit Totem();
|
||||
virtual ~Totem(){};
|
||||
bool Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo const* cinfo, Unit* owner);
|
||||
void Update(uint32 update_diff, uint32 time );
|
||||
void Update(uint32 update_diff, uint32 time) override;
|
||||
void Summon(Unit* owner);
|
||||
void UnSummon();
|
||||
uint32 GetSpell() const { return m_spells[0]; }
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class Transport : public GameObject
|
|||
|
||||
bool Create(uint32 guidlow, uint32 mapid, float x, float y, float z, float ang, uint8 animprogress, uint16 dynamicHighValue);
|
||||
bool GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids);
|
||||
void Update(uint32 update_diff, uint32 p_time);
|
||||
void Update(uint32 update_diff, uint32 p_time) override;
|
||||
bool AddPassenger(Player* passenger);
|
||||
bool RemovePassenger(Player* passenger);
|
||||
|
||||
|
|
|
|||
|
|
@ -1151,7 +1151,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
|||
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
|
||||
void ClearDiminishings() { m_Diminishing.clear(); }
|
||||
|
||||
virtual void Update( uint32 update_diff, uint32 time );
|
||||
void Update(uint32 update_diff, uint32 time) override;
|
||||
|
||||
void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
|
||||
void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11587"
|
||||
#define REVISION_NR "11588"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue