mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10626] Fix logic in FillRaidOrPartyManaPriorityTargets and FillRaidOrPartyHealthPriorityTargets
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
c46d3bf9b0
commit
e74d56f9d2
2 changed files with 7 additions and 7 deletions
|
|
@ -67,7 +67,7 @@ struct PrioritizeMana
|
||||||
{
|
{
|
||||||
int operator()( PrioritizeManaUnitWraper const& x, PrioritizeManaUnitWraper const& y ) const
|
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
|
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);
|
FillRaidOrPartyTargets(targetUnitMap, member, center, radius, raid, withPets, withCaster);
|
||||||
|
|
||||||
PrioritizeManaUnitQueue manaUsers;
|
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())
|
if ((*itr)->getPowerType() == POWER_MANA && !(*itr)->isDead())
|
||||||
manaUsers.push(PrioritizeManaUnitWraper(*itr));
|
manaUsers.push(PrioritizeManaUnitWraper(*itr));
|
||||||
|
|
||||||
targetUnitMap.clear();
|
targetUnitMap.clear();
|
||||||
while(!manaUsers.empty())
|
while(!manaUsers.empty() && targetUnitMap.size() < count)
|
||||||
{
|
{
|
||||||
targetUnitMap.push_back(manaUsers.top().getUnit());
|
targetUnitMap.push_back(manaUsers.top().getUnit());
|
||||||
manaUsers.pop();
|
manaUsers.pop();
|
||||||
|
|
@ -6682,12 +6682,12 @@ void Spell::FillRaidOrPartyHealthPriorityTargets(UnitList &targetUnitMap, Unit*
|
||||||
FillRaidOrPartyTargets(targetUnitMap, member, center, radius, raid, withPets, withCaster);
|
FillRaidOrPartyTargets(targetUnitMap, member, center, radius, raid, withPets, withCaster);
|
||||||
|
|
||||||
PrioritizeHealthUnitQueue healthQueue;
|
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())
|
if (!(*itr)->isDead())
|
||||||
healthQueue.push(PrioritizeHealthUnitWraper(*itr));
|
healthQueue.push(PrioritizeHealthUnitWraper(*itr));
|
||||||
|
|
||||||
targetUnitMap.clear();
|
targetUnitMap.clear();
|
||||||
while(!healthQueue.empty())
|
while(!healthQueue.empty() && targetUnitMap.size() < count)
|
||||||
{
|
{
|
||||||
targetUnitMap.push_back(healthQueue.top().getUnit());
|
targetUnitMap.push_back(healthQueue.top().getUnit());
|
||||||
healthQueue.pop();
|
healthQueue.pop();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10465"
|
#define REVISION_NR "10626"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue