From 1973f017ffbfd2344851544db5f87109e8796d2b Mon Sep 17 00:00:00 2001 From: ApoC Date: Wed, 16 Jun 2010 23:26:53 +0200 Subject: [PATCH] [10066] Some tuning in consts. Signed-off-by: ApoC --- src/game/Player.cpp | 2 +- src/game/Player.h | 4 ++-- src/game/Unit.cpp | 2 +- src/game/Unit.h | 8 ++++---- src/shared/revision_nr.h | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 23379ca6a5a..f5aefac8324 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -17595,7 +17595,7 @@ void Player::RemoveMiniPet() } } -Pet* Player::GetMiniPet() +Pet* Player::GetMiniPet() const { if (!m_miniPet) return NULL; diff --git a/src/game/Player.h b/src/game/Player.h index 8a03ecc973c..f4e258a622c 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1189,7 +1189,7 @@ class MANGOS_DLL_SPEC Player : public Unit void RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent = false); void RemoveMiniPet(); - Pet* GetMiniPet(); + Pet* GetMiniPet() const; void SetMiniPet(Pet* pet) { m_miniPet = pet->GetGUID(); } template @@ -2716,7 +2716,7 @@ template bool Player::CheckAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms, bool withMiniPet) const { if (withMiniPet) - if(Unit* mini = GetMiniPet()) + if(Unit const* mini = GetMiniPet()) if (func(mini)) return true; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 22d07678ac5..ca8e033afcb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -8549,7 +8549,7 @@ void Unit::CombatStopWithPets(bool includingCast) struct IsAttackingPlayerHelper { explicit IsAttackingPlayerHelper() {} - bool operator()(Unit* unit) const { return unit->isAttackingPlayer(); } + inline bool operator()(Unit const* unit) const { return unit->isAttackingPlayer(); } }; bool Unit::isAttackingPlayer() const diff --git a/src/game/Unit.h b/src/game/Unit.h index d02235dd630..76533ffcb64 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1950,14 +1950,14 @@ void Unit::CallForAllControlledUnits(Func const& func, bool withTotems, bool wit template bool Unit::CheckAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms) const { - if (Pet* pet = GetPet()) + if (Pet const* pet = GetPet()) if (func(pet)) return true; if (withGuardians) { for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr) - if (Unit* guardian = Unit::GetUnit(*this,*itr)) + if (Unit const* guardian = Unit::GetUnit(*this,*itr)) if (func(guardian)) return true; @@ -1966,13 +1966,13 @@ bool Unit::CheckAllControlledUnits(Func const& func, bool withTotems, bool withG if (withTotems) { for (int i = 0; i < MAX_TOTEM_SLOT; ++i) - if (Unit *totem = _GetTotem(TotemSlot(i))) + if (Unit const* totem = _GetTotem(TotemSlot(i))) if (func(totem)) return true; } if (withCharms) - if(Unit* charm = GetCharm()) + if(Unit const* charm = GetCharm()) if (func(charm)) return true; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c166a35374a..ff8a742d67d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10065" + #define REVISION_NR "10066" #endif // __REVISION_NR_H__