aboutsummaryrefslogtreecommitdiff
path: root/src/game/PetAI.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-31 13:58:33 -0600
committermegamage <none@none>2009-01-31 13:58:33 -0600
commitd20eaef1d6c7b8d629347b51583cbcf954ff96ed (patch)
tree0387ea5eed3569d49ffcac9553ada179fba645f0 /src/game/PetAI.cpp
parentbe27bd230cbefc8241ab8704bef8894252403ea2 (diff)
parent1f2292af796d4b424bf45711ae8c50e764cf0d61 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/PetAI.cpp')
-rw-r--r--src/game/PetAI.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp
index 0a93bea158d..398861d8d37 100644
--- a/src/game/PetAI.cpp
+++ b/src/game/PetAI.cpp
@@ -38,7 +38,7 @@ int PetAI::Permissible(const Creature *creature)
return PERMIT_BASE_NO;
}
-PetAI::PetAI(Creature *c) : i_pet(*c), i_tracker(TIME_INTERVAL_LOOK), inCombat(false)
+PetAI::PetAI(Creature *c) : CreatureAI(c), i_pet(*c), i_tracker(TIME_INTERVAL_LOOK), inCombat(false)
{
m_AllySet.clear();
UpdateAllies();
@@ -73,8 +73,6 @@ void PetAI::AttackStart(Unit *u)
if(i_pet.Attack(u,true))
{
- i_pet.SetInCombatWith(u);
-
i_pet.clearUnitState(UNIT_STAT_FOLLOW);
// TMGs call CreatureRelocation which via MoveInLineOfSight can call this function
// thus with the following clear the original TMG gets invalidated and crash, doh
@@ -89,11 +87,6 @@ void PetAI::EnterEvadeMode()
{
}
-bool PetAI::IsVisible(Unit *pl) const
-{
- return _isVisible(pl);
-}
-
bool PetAI::_needToStop() const
{
// This is needed for charmed creatures, as once their target was reset other effects can trigger threat
@@ -293,13 +286,6 @@ void PetAI::UpdateAI(const uint32 diff)
}
}
-bool PetAI::_isVisible(Unit *u) const
-{
- //return false; //( ((Creature*)&i_pet)->GetDistanceSq(u) * 1.0<= sWorld.getConfig(CONFIG_SIGHT_GUARDER) && !u->m_stealth && u->isAlive());
- return i_pet.GetDistance(u) < sWorld.getConfig(CONFIG_SIGHT_GUARDER)
- && u->isVisibleForOrDetect(&i_pet,true);
-}
-
void PetAI::UpdateAllies()
{
Unit* owner = i_pet.GetCharmerOrOwner();