mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 16:43:47 +00:00
refactor(Core/Misc): ceil() to std::ceil() (#9791)
- prefer std functions over C functions
This commit is contained in:
@@ -214,7 +214,7 @@ struct CreatureBaseStats
|
||||
|
||||
uint32 GenerateHealth(CreatureTemplate const* info) const
|
||||
{
|
||||
return uint32(ceil(BaseHealth[info->expansion] * info->ModHealth));
|
||||
return uint32(std::ceil(BaseHealth[info->expansion] * info->ModHealth));
|
||||
}
|
||||
|
||||
uint32 GenerateMana(CreatureTemplate const* info) const
|
||||
@@ -223,12 +223,12 @@ struct CreatureBaseStats
|
||||
if (!BaseMana)
|
||||
return 0;
|
||||
|
||||
return uint32(ceil(BaseMana * info->ModMana));
|
||||
return uint32(std::ceil(BaseMana * info->ModMana));
|
||||
}
|
||||
|
||||
uint32 GenerateArmor(CreatureTemplate const* info) const
|
||||
{
|
||||
return uint32(ceil(BaseArmor * info->ModArmor));
|
||||
return uint32(std::ceil(BaseArmor * info->ModArmor));
|
||||
}
|
||||
|
||||
float GenerateBaseDamage(CreatureTemplate const* info) const
|
||||
|
||||
@@ -5926,7 +5926,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
||||
else
|
||||
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
|
||||
|
||||
honor_f = ceil(Acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
honor_f = std::ceil(Acore::Honor::hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey));
|
||||
|
||||
// count the number of playerkills in one day
|
||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||
@@ -12129,7 +12129,7 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
|
||||
|
||||
time_t now = time(nullptr);
|
||||
// 0..2 full period
|
||||
// should be ceil(x)-1 but not floor(x)
|
||||
// should be std::ceil(x)-1 but not floor(x)
|
||||
uint64 count = (now < m_deathExpireTime - 1) ? (m_deathExpireTime - 1 - now) / DEATH_EXPIRE_STEP : 0;
|
||||
return copseReclaimDelay[count];
|
||||
}
|
||||
|
||||
@@ -9311,7 +9311,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
|
||||
uint8 fofRank = sSpellMgr->GetSpellRank(triggeredByAura->GetId());
|
||||
uint8 fbRank = sSpellMgr->GetSpellRank(aurEff->GetId());
|
||||
uint8 chance = uint8(ceil(fofRank * fbRank * 16.6f));
|
||||
uint8 chance = uint8(std::ceil(fofRank * fbRank * 16.6f));
|
||||
|
||||
if (roll_chance_i(chance))
|
||||
CastSpell(victim, aurEff->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
|
||||
|
||||
Reference in New Issue
Block a user