From 8b6a1db20215ba54a43789c0f809152855fd2fbc Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Tue, 16 Jan 2024 20:18:25 +0100 Subject: Core/Units: moved health and power ordering predicates from Unit header into CommonPredicates (#29584) (cherry picked from commit 2f6ed2c203b16a1d1e85f61a8b8e2cf3d1a4e784) --- src/server/scripts/Spells/spell_generic.cpp | 3 ++- src/server/scripts/Spells/spell_item.cpp | 3 ++- src/server/scripts/Spells/spell_paladin.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 58a5770b025..58a81103a16 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -26,6 +26,7 @@ #include "Battleground.h" #include "BattlePetMgr.h" #include "CellImpl.h" +#include "CommonPredicates.h" #include "Containers.h" #include "CreatureAI.h" #include "DB2Stores.h" @@ -2991,7 +2992,7 @@ class spell_gen_replenishment : public SpellScript if (targets.size() > maxTargets) { - targets.sort(Trinity::PowerPctOrderPred(POWER_MANA)); + targets.sort(Trinity::Predicates::PowerPctOrderPred(POWER_MANA)); targets.resize(maxTargets); } } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index d65c4015c9a..0c687dc36c1 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -23,6 +23,7 @@ #include "ScriptMgr.h" #include "Battleground.h" +#include "CommonPredicates.h" #include "Containers.h" #include "Creature.h" #include "CreatureAIImpl.h" @@ -995,7 +996,7 @@ class spell_item_echoes_of_light : public SpellScript if (targets.size() < 2) return; - targets.sort(Trinity::HealthPctOrderPred()); + targets.sort(Trinity::Predicates::HealthPctOrderPred()); WorldObject* target = targets.front(); targets.clear(); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 53cda732603..c16a8741558 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -24,6 +24,7 @@ #include "ScriptMgr.h" #include "AreaTrigger.h" #include "AreaTriggerAI.h" +#include "CommonPredicates.h" #include "Containers.h" #include "DB2Stores.h" #include "Group.h" @@ -418,7 +419,7 @@ class spell_pal_glyph_of_holy_light : public SpellScript if (targets.size() > maxTargets) { - targets.sort(Trinity::HealthPctOrderPred()); + targets.sort(Trinity::Predicates::HealthPctOrderPred()); targets.resize(maxTargets); } } -- cgit v1.2.3