refactor UnitAI::SelectTarget to allow having a predicate function (1st step).
--HG-- branch : trunk
This commit is contained in:
1 parent
e010310c6d
commit
d9056adc8a
7 files changed
+113
-96
No files matched your search
@@ -1588,19 +1588,6 @@ struct ChainHealingOrder : public std::binary_function<const Unit*, const Unit*,
|
||||
}
|
||||
};
|
||||
|
||||
// Helper for targets nearest to the spell target
|
||||
// The spell target is always first unless there is a target at _completely_ the same position (unbelievable case)
|
||||
struct TargetDistanceOrder : public std::binary_function<const Unit, const Unit, bool>
|
||||
{
|
||||
const Unit* MainTarget;
|
||||
TargetDistanceOrder(const Unit* Target) : MainTarget(Target) {};
|
||||
// functor for operator ">"
|
||||
bool operator()(const Unit* _Left, const Unit* _Right) const
|
||||
{
|
||||
return MainTarget->GetDistanceOrder(_Left,_Right);
|
||||
}
|
||||
};
|
||||
|
||||
void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uint32 num, SpellTargets TargetType)
|
||||
{
|
||||
Unit *cur = m_targets.getUnitTarget();
|
||||
|
||||
Reference in new issue
Block a user