@@ -4771,7 +4771,7 @@ void Spell::SendSpellStart()
47714771
47724772 if ((m_caster->GetTypeId () == TYPEID_PLAYER ||
47734773 (m_caster->GetTypeId () == TYPEID_UNIT && m_caster->ToCreature ()->IsPet ()))
4774- && std::find_if (m_powerCost. begin (), m_powerCost. end (), [](SpellPowerCost const & cost) { return cost.Power != POWER_HEALTH; }) != m_powerCost. end ( ))
4774+ && std::ranges::any_of (m_powerCost, [](SpellPowerCost const & cost) { return cost.Power != POWER_HEALTH; }))
47754775 castFlags |= CAST_FLAG_POWER_LEFT_SELF;
47764776
47774777 if (HasPowerTypeCost (POWER_RUNES))
@@ -4870,7 +4870,7 @@ void Spell::SendSpellGo()
48704870
48714871 if ((m_caster->GetTypeId () == TYPEID_PLAYER ||
48724872 (m_caster->GetTypeId () == TYPEID_UNIT && m_caster->ToCreature ()->IsPet ()))
4873- && std::find_if (m_powerCost. begin (), m_powerCost. end (), [](SpellPowerCost const & cost) { return cost.Power != POWER_HEALTH; }) != m_powerCost. end ( ))
4873+ && std::ranges::any_of (m_powerCost, [](SpellPowerCost const & cost) { return cost.Power != POWER_HEALTH; }))
48744874 castFlags |= CAST_FLAG_POWER_LEFT_SELF;
48754875
48764876 if ((m_caster->GetTypeId () == TYPEID_PLAYER)
@@ -8150,11 +8150,7 @@ bool Spell::HasPowerTypeCost(Powers power) const
81508150
81518151Optional<int32> Spell::GetPowerTypeCostAmount (Powers power) const
81528152{
8153- auto itr = std::find_if (m_powerCost.cbegin (), m_powerCost.cend (), [power](SpellPowerCost const & cost)
8154- {
8155- return cost.Power == power;
8156- });
8157-
8153+ auto itr = std::ranges::find (m_powerCost, power, &SpellPowerCost::Power);
81588154 if (itr == m_powerCost.cend ())
81598155 return { };
81608156
@@ -9590,7 +9586,7 @@ void SelectRandomInjuredTargets(std::list<WorldObject*>& targets, size_t maxTarg
95909586 tempTargets.resize (targets.size ());
95919587
95929588 // categorize each target
9593- std::transform (targets. begin (), targets. end () , tempTargets.begin (), [&](WorldObject* target)
9589+ std::ranges:: transform (targets, tempTargets.begin (), [&](WorldObject* target)
95949590 {
95959591 int32 negativePoints = 0 ;
95969592 if (prioritizeGroupMembersOf && (!target->IsUnit () || target->ToUnit ()->IsInRaidWith (prioritizeGroupMembersOf)))
0 commit comments