Skip to content

Commit

Permalink
[10066] Some tuning in consts.
Browse files Browse the repository at this point in the history
Signed-off-by: ApoC <apoc@nymfe.net>
  • Loading branch information
apoc committed Jun 16, 2010
1 parent d042b04 commit 1973f01
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/game/Player.cpp
Expand Up @@ -17595,7 +17595,7 @@ void Player::RemoveMiniPet()
}
}

Pet* Player::GetMiniPet()
Pet* Player::GetMiniPet() const
{
if (!m_miniPet)
return NULL;
Expand Down
4 changes: 2 additions & 2 deletions src/game/Player.h
Expand Up @@ -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<typename Func>
Expand Down Expand Up @@ -2716,7 +2716,7 @@ template<typename Func>
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;

Expand Down
2 changes: 1 addition & 1 deletion src/game/Unit.cpp
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/game/Unit.h
Expand Up @@ -1950,14 +1950,14 @@ void Unit::CallForAllControlledUnits(Func const& func, bool withTotems, bool wit
template<typename Func>
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;

Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion 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__

0 comments on commit 1973f01

Please sign in to comment.