Scripts: Fixed compile

This commit is contained in:
Shauren
2011-05-12 12:08:47 +02:00
parent 28c002f77e
commit 82b5f9c629
2 changed files with 12 additions and 10 deletions
+7 -7
View File
@@ -62,33 +62,33 @@ struct DefaultTargetSelector : public std::unary_function<Unit* , bool>
// aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura
DefaultTargetSelector(Unit const* pUnit, float dist, bool playerOnly, int32 aura) : me(pUnit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {} DefaultTargetSelector(Unit const* pUnit, float dist, bool playerOnly, int32 aura) : me(pUnit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {}
bool operator() (Unit const* pTarget) bool operator()(Unit const* target) const
{ {
if (!me) if (!me)
return false; return false;
if (!pTarget) if (!target)
return false; return false;
if (m_playerOnly && (pTarget->GetTypeId() != TYPEID_PLAYER)) if (m_playerOnly && (target->GetTypeId() != TYPEID_PLAYER))
return false; return false;
if (m_dist > 0.0f && !me->IsWithinCombatRange(pTarget, m_dist)) if (m_dist > 0.0f && !me->IsWithinCombatRange(target, m_dist))
return false; return false;
if (m_dist < 0.0f && me->IsWithinCombatRange(pTarget, -m_dist)) if (m_dist < 0.0f && me->IsWithinCombatRange(target, -m_dist))
return false; return false;
if (m_aura) if (m_aura)
{ {
if (m_aura > 0) if (m_aura > 0)
{ {
if (!pTarget->HasAura(m_aura)) if (!target->HasAura(m_aura))
return false; return false;
} }
else else
{ {
if (pTarget->HasAura(-m_aura)) if (target->HasAura(-m_aura))
return false; return false;
} }
} }
@@ -244,11 +244,13 @@ const Position PosWeavers[MAX_WEAVERS] =
}; };
// predicate function to select not charmed target // predicate function to select not charmed target
struct NotCharmedTargetSelector : public std::unary_function<Unit *, bool> { struct NotCharmedTargetSelector : public std::unary_function<Unit*, bool>
{
NotCharmedTargetSelector() {} NotCharmedTargetSelector() {}
bool operator() (const Unit *pTarget) { bool operator()(Unit const* target) const
return (!pTarget->isCharmed()); {
return !target->isCharmed();
} }
}; };