[9189] Fixed build error at *nix.

This commit is contained in:
VladimirMangos 2010-01-16 08:36:58 +03:00
parent 132b1cbabd
commit 6f703bab57
3 changed files with 25 additions and 8 deletions

View file

@ -8442,6 +8442,20 @@ Pet* Unit::FindGuardianWithEntry(uint32 entry)
return NULL;
}
Unit* Unit::_GetTotem(uint8 slot) const
{
return GetTotem(slot);
}
Totem* Unit::GetTotem( uint8 slot ) const
{
if(slot >= MAX_TOTEM)
return NULL;
Creature *totem = GetMap()->GetCreature(m_TotemSlot[slot]);
return totem->isTotem() ? (Totem*)totem : NULL;
}
void Unit::UnsummonAllTotems()
{
for (int8 i = 0; i < MAX_TOTEM; ++i)

View file

@ -299,6 +299,7 @@ class Item;
class Pet;
class Path;
class PetAura;
class Totem;
struct SpellImmune
{
@ -1242,6 +1243,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0);
Totem* GetTotem(uint8 slot) const;
template<typename Func>
void CallForAllControlledUnits(Func const& func, bool withTotems, bool withGuardians, bool withCharms);
template<typename Func>
@ -1645,6 +1648,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
float GetCombatRatingReduction(CombatRating cr) const;
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const;
Unit* _GetTotem(uint8 slot) const; // for templated function without include need
uint32 m_state; // Even derived shouldn't modify
uint32 m_CombatTimer;
@ -1681,8 +1686,7 @@ void Unit::CallForAllControlledUnits(Func const& func, bool withTotems, bool wit
if (withTotems)
{
for (int8 i = 0; i < MAX_TOTEM; ++i)
if(m_TotemSlot[i])
if(Creature *totem = GetMap()->GetCreature(m_TotemSlot[i]))
if (Unit *totem = _GetTotem(i))
func(totem);
}
@ -1711,8 +1715,7 @@ bool Unit::CheckAllControlledUnits(Func const& func, bool withTotems, bool withG
if (withTotems)
{
for (int8 i = 0; i < MAX_TOTEM; ++i)
if (m_TotemSlot[i])
if (Creature *totem = GetMap()->GetCreature(m_TotemSlot[i]))
if (Unit *totem = _GetTotem(i))
if (func(totem))
return true;
}

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9188"
#define REVISION_NR "9189"
#endif // __REVISION_NR_H__