refactor(Core/Misc): abs() to std::abs() (#9789)

This commit is contained in:
Kitzunu
2021-12-31 23:29:39 +01:00
committed by GitHub
parent fe9305c724
commit ac99eb48e1
25 changed files with 60 additions and 60 deletions

View File

@@ -5799,7 +5799,7 @@ void Player::RewardReputation(Quest const* quest)
uint32 row = ((quest->RewardFactionValueId[i] < 0) ? 1 : 0) + 1;
if (QuestFactionRewEntry const* questFactionRewEntry = sQuestFactionRewardStore.LookupEntry(row))
{
uint32 field = abs(quest->RewardFactionValueId[i]);
uint32 field = std::abs(quest->RewardFactionValueId[i]);
rep = questFactionRewEntry->QuestRewFactionValue[field];
}
}

View File

@@ -987,7 +987,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) const
for (Quest::PrevQuests::const_iterator iter = qInfo->prevQuests.begin(); iter != qInfo->prevQuests.end(); ++iter)
{
uint32 prevId = abs(*iter);
uint32 prevId = std::abs(*iter);
Quest const* qPrevInfo = sObjectMgr->GetQuestTemplate(prevId);

View File

@@ -4399,7 +4399,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
// Random Property Exist - try found basepoints for spell (basepoints depends from item suffix factor)
if (item->GetItemRandomPropertyId())
{
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(std::abs(item->GetItemRandomPropertyId()));
if (item_rand)
{
// Search enchant_amount
@@ -4426,7 +4426,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
case ITEM_ENCHANTMENT_TYPE_RESISTANCE:
if (!enchant_amount)
{
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(std::abs(item->GetItemRandomPropertyId()));
if (item_rand)
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
@@ -4446,7 +4446,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
if (!enchant_amount)
{
ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(abs(item->GetItemRandomPropertyId()));
ItemRandomSuffixEntry const* item_rand_suffix = sItemRandomSuffixStore.LookupEntry(std::abs(item->GetItemRandomPropertyId()));
if (item_rand_suffix)
{
for (int k = 0; k < MAX_ITEM_ENCHANTMENT_EFFECTS; ++k)
@@ -5215,7 +5215,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
map = sMapMgr->CreateMap(mapId, this);
if (map)
{
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(abs(transLowGUID));
auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(std::abs(transLowGUID));
if (bounds.first != bounds.second)
transGO = bounds.first->second->ToTransport();
}