fix(Core/Unit): -Wdeprecated-enum-enum-conversion warning (#6868)

This commit is contained in:
Francesco Borzì
2021-07-13 11:51:58 +02:00
committed by GitHub
parent 1fa51e5168
commit f73ef1cd5a
18 changed files with 77 additions and 87 deletions

View File

@@ -2169,7 +2169,7 @@ void Player::Regenerate(Powers power)
//Set the value to 0 first then set it to max to force resend of packet as for range clients keeps removing rage
if (power == POWER_RAGE || power == POWER_RUNIC_POWER)
{
UpdateUInt32Value(UNIT_FIELD_POWER1 + power, 0);
UpdateUInt32Value(static_cast<uint16>(UNIT_FIELD_POWER1) + power, 0);
}
SetPower(power, maxValue);
@@ -2289,7 +2289,7 @@ void Player::Regenerate(Powers power)
if (m_regenTimerCount >= 2000)
SetPower(power, curValue);
else
UpdateUInt32Value(UNIT_FIELD_POWER1 + power, curValue);
UpdateUInt32Value(static_cast<uint16>(UNIT_FIELD_POWER1) + power, curValue);
}
void Player::RegenerateHealth()
@@ -5484,7 +5484,7 @@ void Player::GetDodgeFromAgility(float& diminishing, float& nondiminishing)
return;
// TODO: research if talents/effects that increase total agility by x% should increase non-diminishing part
float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + STAT_AGILITY][BASE_PCT];
float base_agility = GetCreateStat(STAT_AGILITY) * m_auraModifiersGroup[UNIT_MOD_STAT_START + static_cast<uint16>(STAT_AGILITY)][BASE_PCT];
float bonus_agility = GetStat(STAT_AGILITY) - base_agility;
// calculate diminishing (green in char screen) and non-diminishing (white) contribution
@@ -5527,7 +5527,7 @@ float Player::GetRatingMultiplier(CombatRating cr) const
float Player::GetRatingBonusValue(CombatRating cr) const
{
return float(GetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr)) * GetRatingMultiplier(cr);
return float(GetUInt32Value(static_cast<uint16>(PLAYER_FIELD_COMBAT_RATING_1) + cr)) * GetRatingMultiplier(cr);
}
float Player::GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
@@ -5631,7 +5631,7 @@ void Player::UpdateRating(CombatRating cr)
amount += int32(CalculatePct(GetStat(Stats((*i)->GetMiscValueB())), (*i)->GetAmount()));
if (amount < 0)
amount = 0;
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, uint32(amount));
SetUInt32Value(static_cast<uint16>(PLAYER_FIELD_COMBAT_RATING_1) + cr, uint32(amount));
bool affectStats = CanModifyStats();