Fixed Carrion Feeder pet talent

Removed useless code for Wolverine Bite

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-08-04 12:12:58 +02:00
parent dc6c3f96b1
commit 705de07e7e
7 changed files with 96 additions and 5 deletions
@@ -349,5 +349,22 @@ bool CannibalizeObjectCheck::operator()(Corpse* u)
return false;
}
bool CarrionFeederObjectCheck::operator()(Corpse* u)
{
// ignore bones
if (u->GetType() == CORPSE_BONES)
return false;
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID());
if (!owner || i_funit->IsFriendlyTo(owner))
return false;
if (i_funit->IsWithinDistInMap(u, i_range))
return true;
return false;
}
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
@@ -562,6 +562,32 @@ namespace Trinity
float i_range;
};
class CarrionFeederObjectCheck
{
public:
CarrionFeederObjectCheck(Unit* funit, float range) : i_funit(funit), i_range(range) {}
bool operator()(Player* u)
{
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight())
return false;
return i_funit->IsWithinDistInMap(u, i_range);
}
bool operator()(Corpse* u);
bool operator()(Creature* u)
{
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() ||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0)
return false;
return i_funit->IsWithinDistInMap(u, i_range);
}
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
private:
Unit* const i_funit;
float i_range;
};
// WorldObject do classes
class RespawnDo