mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 22:19:54 -04:00
Core/Misc: Fixed deprecation warnings for c++20
(cherry picked from commit ba9bbbc9d0)
This commit is contained in:
@@ -4954,8 +4954,8 @@ void Unit::UpdateResistanceBuffModsMod(SpellSchools school)
|
||||
modPos *= factor;
|
||||
modNeg *= factor;
|
||||
|
||||
SetFloatValue(UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + school, modPos);
|
||||
SetFloatValue(UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + school, modNeg);
|
||||
SetFloatValue(UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE + AsUnderlyingType(school), modPos);
|
||||
SetFloatValue(UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE + AsUnderlyingType(school), modNeg);
|
||||
}
|
||||
|
||||
void Unit::InitStatBuffMods()
|
||||
@@ -4972,7 +4972,7 @@ void Unit::UpdateStatBuffMod(Stats stat)
|
||||
float modNeg = 0.0f;
|
||||
float factor = 0.0f;
|
||||
|
||||
UnitMods const unitMod = static_cast<UnitMods>(UNIT_MOD_STAT_START + stat);
|
||||
UnitMods const unitMod = static_cast<UnitMods>(UNIT_MOD_STAT_START + AsUnderlyingType(stat));
|
||||
|
||||
// includes value from items and enchantments
|
||||
float modValue = GetFlatModifierValue(unitMod, BASE_VALUE);
|
||||
@@ -5021,8 +5021,8 @@ void Unit::UpdateStatBuffMod(Stats stat)
|
||||
modPos *= factor;
|
||||
modNeg *= factor;
|
||||
|
||||
SetFloatValue(UNIT_FIELD_POSSTAT0 + stat, modPos);
|
||||
SetFloatValue(UNIT_FIELD_NEGSTAT0 + stat, modNeg);
|
||||
SetFloatValue(UNIT_FIELD_POSSTAT0 + AsUnderlyingType(stat), modPos);
|
||||
SetFloatValue(UNIT_FIELD_NEGSTAT0 + AsUnderlyingType(stat), modNeg);
|
||||
}
|
||||
|
||||
void Unit::_RegisterDynObject(DynamicObject* dynObj)
|
||||
@@ -7023,7 +7023,7 @@ float Unit::SpellCritChanceDone(SpellInfo const* spellInfo, SpellSchoolMask scho
|
||||
crit_chance = 0.0f;
|
||||
// For other schools
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + GetFirstSchoolInMask(schoolMask));
|
||||
crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + AsUnderlyingType(GetFirstSchoolInMask(schoolMask)));
|
||||
else
|
||||
{
|
||||
crit_chance = (float)m_baseSpellCritChance;
|
||||
@@ -8461,7 +8461,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal, bool withPowerUpdate /*= true*
|
||||
|
||||
uint32 Unit::GetAttackTime(WeaponAttackType att) const
|
||||
{
|
||||
float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + att) / m_modAttackSpeedPct[att];
|
||||
float f_BaseAttackTime = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + AsUnderlyingType(att)) / m_modAttackSpeedPct[att];
|
||||
return (uint32)f_BaseAttackTime;
|
||||
}
|
||||
|
||||
@@ -9212,7 +9212,7 @@ void Unit::UpdateAllDamagePctDoneMods()
|
||||
|
||||
float Unit::GetTotalStatValue(Stats stat) const
|
||||
{
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + stat);
|
||||
UnitMods unitMod = UnitMods(UNIT_MOD_STAT_START + AsUnderlyingType(stat));
|
||||
|
||||
// value = ((base_value * base_pct) + total_value) * total_pct
|
||||
float value = GetFlatModifierValue(unitMod, BASE_VALUE) + GetCreateStat(stat);
|
||||
@@ -9411,7 +9411,7 @@ void Unit::SetPower(Powers power, uint32 val, bool withPowerUpdate /*= true*/)
|
||||
if (maxPower < val)
|
||||
val = maxPower;
|
||||
|
||||
SetStatInt32Value(UNIT_FIELD_POWER1 + power, val);
|
||||
SetStatInt32Value(UNIT_FIELD_POWER1 + AsUnderlyingType(power), val);
|
||||
|
||||
if (withPowerUpdate)
|
||||
{
|
||||
@@ -9446,7 +9446,7 @@ void Unit::SetPower(Powers power, uint32 val, bool withPowerUpdate /*= true*/)
|
||||
void Unit::SetMaxPower(Powers power, uint32 val)
|
||||
{
|
||||
uint32 cur_power = GetPower(power);
|
||||
SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + power, val);
|
||||
SetStatInt32Value(UNIT_FIELD_MAXPOWER1 + AsUnderlyingType(power), val);
|
||||
|
||||
// group update
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -10603,7 +10603,7 @@ void ApplyPercentModFloatVar(float& var, float val, bool apply)
|
||||
|
||||
void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
|
||||
{
|
||||
float amount = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + att);
|
||||
float amount = GetFloatValue(UNIT_FIELD_BASEATTACKTIME + AsUnderlyingType(att));
|
||||
|
||||
float remainingTimePct = (float)m_attackTimer[att] / (GetAttackTime(att) * m_modAttackSpeedPct[att]);
|
||||
if (val > 0.f)
|
||||
@@ -10617,7 +10617,7 @@ void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply
|
||||
ApplyPercentModFloatVar(amount, -val, apply);
|
||||
}
|
||||
|
||||
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + att, amount);
|
||||
SetFloatValue(UNIT_FIELD_BASEATTACKTIME + AsUnderlyingType(att), amount);
|
||||
m_attackTimer[att] = uint32(GetAttackTime(att) * m_modAttackSpeedPct[att] * remainingTimePct);
|
||||
}
|
||||
|
||||
@@ -12754,7 +12754,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
|
||||
}
|
||||
}
|
||||
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, vehicleCollisionHeight = vehicle->GetBase()->GetCollisionHeight()](Movement::MoveSplineInit& init)
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [=, this, vehicleCollisionHeight = vehicle->GetBase()->GetCollisionHeight()](Movement::MoveSplineInit& init)
|
||||
{
|
||||
float height = pos.GetPositionZ() + vehicleCollisionHeight;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user