[10626] Fix logic in FillRaidOrPartyManaPriorityTargets and FillRaidOrPartyHealthPriorityTargets

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
zerg 2010-10-20 02:55:08 +04:00 committed by VladimirMangos
parent c46d3bf9b0
commit e74d56f9d2
2 changed files with 7 additions and 7 deletions

View file

@ -67,7 +67,7 @@ struct PrioritizeMana
{
int operator()( PrioritizeManaUnitWraper const& x, PrioritizeManaUnitWraper const& y ) const
{
return x.getPercent() < y.getPercent();
return x.getPercent() > y.getPercent();
}
};
@ -91,7 +91,7 @@ struct PrioritizeHealth
{
int operator()( PrioritizeHealthUnitWraper const& x, PrioritizeHealthUnitWraper const& y ) const
{
return x.getPercent() < y.getPercent();
return x.getPercent() > y.getPercent();
}
};
@ -6665,12 +6665,12 @@ void Spell::FillRaidOrPartyManaPriorityTargets(UnitList &targetUnitMap, Unit* me
FillRaidOrPartyTargets(targetUnitMap, member, center, radius, raid, withPets, withCaster);
PrioritizeManaUnitQueue manaUsers;
for(UnitList::const_iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end() && manaUsers.size() < count; ++itr)
for(UnitList::const_iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end(); ++itr)
if ((*itr)->getPowerType() == POWER_MANA && !(*itr)->isDead())
manaUsers.push(PrioritizeManaUnitWraper(*itr));
targetUnitMap.clear();
while(!manaUsers.empty())
while(!manaUsers.empty() && targetUnitMap.size() < count)
{
targetUnitMap.push_back(manaUsers.top().getUnit());
manaUsers.pop();
@ -6682,12 +6682,12 @@ void Spell::FillRaidOrPartyHealthPriorityTargets(UnitList &targetUnitMap, Unit*
FillRaidOrPartyTargets(targetUnitMap, member, center, radius, raid, withPets, withCaster);
PrioritizeHealthUnitQueue healthQueue;
for(UnitList::const_iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end() && healthQueue.size() < count; ++itr)
for(UnitList::const_iterator itr = targetUnitMap.begin(); itr != targetUnitMap.end(); ++itr)
if (!(*itr)->isDead())
healthQueue.push(PrioritizeHealthUnitWraper(*itr));
targetUnitMap.clear();
while(!healthQueue.empty())
while(!healthQueue.empty() && targetUnitMap.size() < count)
{
targetUnitMap.push_back(healthQueue.top().getUnit());
healthQueue.pop();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10465"
#define REVISION_NR "10626"
#endif // __REVISION_NR_H__