aboutsummaryrefslogtreecommitdiff
path: root/src/game/ThreatManager.cpp
diff options
context:
space:
mode:
authorXanadu <none@none>2010-05-30 04:23:27 +0200
committerXanadu <none@none>2010-05-30 04:23:27 +0200
commit7fbeef3d09dac072aec046519a90d95f0572fcf6 (patch)
tree9808843d603e64ef863e823c89b764d0bab8dcf1 /src/game/ThreatManager.cpp
parent14382dd1fe74c500d26b597e8de1498dcc30da68 (diff)
Cleaned up and unified various sort predicates and moved them to Trinity namespace, replaced priority queues with sorts and purged some unused code.
--HG-- branch : trunk
Diffstat (limited to 'src/game/ThreatManager.cpp')
-rw-r--r--src/game/ThreatManager.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp
index fcc3b466954..52f02f0f66d 100644
--- a/src/game/ThreatManager.cpp
+++ b/src/game/ThreatManager.cpp
@@ -246,21 +246,13 @@ void ThreatContainer::modifyThreatPercent(Unit *pVictim, int32 iPercent)
}
//============================================================
-
-bool HostileReferenceSortPredicate(const HostileReference* lhs, const HostileReference* rhs)
-{
- // std::list::sort ordering predicate must be: (Pred(x,y)&&Pred(y,x)) == false
- return lhs->getThreat() > rhs->getThreat(); // reverse sorting
-}
-
-//============================================================
// Check if the list is dirty and sort if necessary
void ThreatContainer::update()
{
if (iDirty && iThreatList.size() >1)
- {
- iThreatList.sort(HostileReferenceSortPredicate);
+ {
+ iThreatList.sort(Trinity::ThreatOrderPred());
}
iDirty = false;
}