diff options
| author | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-07-24 13:44:55 +0200 | 
|---|---|---|
| committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-07-24 13:44:55 +0200 | 
| commit | e68ebd33395569e9aa006acd04645973d9c96187 (patch) | |
| tree | d2390c2ad6ecb486bf5a9fbfa33ec531dfcc7812 | |
| parent | 4c2f7df4f39cd98eae21bc64ebac59e3d2eea577 (diff) | |
Core/Misc: Replace some abs() with std::abs()
Always prefer std:: math function compared to C ones, as done in 7fe7f30521503559dc8aee9f3127e11111f8ccc4
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d643235ed26..f8773b7c7f8 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -436,7 +436,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster)                  {                      if (castItem->GetItemSuffixFactor())                      { -                        if (ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(castItem->GetItemRandomPropertyId()))) +                        if (ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(std::abs(castItem->GetItemRandomPropertyId())))                          {                              for (uint8 k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)                              { @@ -3365,7 +3365,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo      Unit* target = aurApp->GetTarget();      int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_STAT, true, GetMiscValue()); -    if (abs(spellGroupVal) >= abs(GetAmount())) +    if (std::abs(spellGroupVal) >= std::abs(GetAmount()))          return;      for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) @@ -3902,7 +3902,7 @@ void AuraEffect::HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode      }      int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, GetAuraType()); -    if (abs(spellGroupVal) >= abs(GetAmount())) +    if (std::abs(spellGroupVal) >= std::abs(GetAmount()))          return;      if (spellGroupVal) @@ -3930,7 +3930,7 @@ void AuraEffect::HandleModCombatSpeedPct(AuraApplication const* aurApp, uint8 mo      Unit* target = aurApp->GetTarget();      int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MELEE_SLOW); -    if (abs(spellGroupVal) >= abs(GetAmount())) +    if (std::abs(spellGroupVal) >= std::abs(GetAmount()))          return;      if (spellGroupVal) @@ -3964,7 +3964,7 @@ void AuraEffect::HandleModMeleeSpeedPct(AuraApplication const* aurApp, uint8 mod      Unit* target = aurApp->GetTarget();      int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_MELEE_HASTE); -    if (abs(spellGroupVal) >= abs(GetAmount())) +    if (std::abs(spellGroupVal) >= std::abs(GetAmount()))          return;      if (spellGroupVal)  | 
