mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
fix(Core/Misc): Change const to be after type name (#10591)
This commit is contained in:
@@ -604,7 +604,7 @@ void Unit::resetAttackTimer(WeaponAttackType type)
|
||||
m_attackTimer[type] = std::min(m_attackTimer[type] + time, time);
|
||||
}
|
||||
|
||||
bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
|
||||
bool Unit::IsWithinCombatRange(Unit const* obj, float dist2compare) const
|
||||
{
|
||||
if (!obj || !IsInMap(obj) || !InSamePhase(obj))
|
||||
return false;
|
||||
@@ -620,7 +620,7 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
|
||||
return distsq < maxdist * maxdist;
|
||||
}
|
||||
|
||||
bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const
|
||||
bool Unit::IsWithinMeleeRange(Unit const* obj, float dist) const
|
||||
{
|
||||
if (!obj || !IsInMap(obj) || !InSamePhase(obj))
|
||||
return false;
|
||||
@@ -656,7 +656,7 @@ bool Unit::IsWithinRange(Unit const* obj, float dist) const
|
||||
return distsq <= dist * dist;
|
||||
}
|
||||
|
||||
bool Unit::GetRandomContactPoint(const Unit* obj, float& x, float& y, float& z, bool force) const
|
||||
bool Unit::GetRandomContactPoint(Unit const* obj, float& x, float& y, float& z, bool force) const
|
||||
{
|
||||
float combat_reach = GetCombatReach();
|
||||
if (combat_reach < 0.1f) // sometimes bugged for players
|
||||
@@ -665,7 +665,7 @@ bool Unit::GetRandomContactPoint(const Unit* obj, float& x, float& y, float& z,
|
||||
uint32 attacker_number = getAttackers().size();
|
||||
if (attacker_number > 0)
|
||||
--attacker_number;
|
||||
const Creature* c = obj->ToCreature();
|
||||
Creature const* c = obj->ToCreature();
|
||||
if (c)
|
||||
if (c->isWorldBoss() || c->IsDungeonBoss() || (obj->IsPet() && const_cast<Unit*>(obj)->ToPet()->isControlled()))
|
||||
attacker_number = 0; // pussywizard: pets and bosses just come to target from their angle
|
||||
@@ -2167,7 +2167,7 @@ void Unit::CalcAbsorbResist(DamageInfo& dmgInfo, bool Splited)
|
||||
continue;
|
||||
|
||||
// Xinef: Single Target splits require LoS
|
||||
const SpellInfo* splitSpellInfo = (*itr)->GetSpellInfo();
|
||||
SpellInfo const* splitSpellInfo = (*itr)->GetSpellInfo();
|
||||
if (!splitSpellInfo->Effects[(*itr)->GetEffIndex()].IsAreaAuraEffect() && !splitSpellInfo->HasAttribute(SPELL_ATTR2_IGNORE_LINE_OF_SIGHT))
|
||||
if (!caster->IsWithinLOSInMap(victim) || !caster->IsWithinDist(victim, splitSpellInfo->GetMaxRange(splitSpellInfo->IsPositive(), caster)))
|
||||
continue;
|
||||
@@ -2465,7 +2465,7 @@ void Unit::HandleProcExtraAttackFor(Unit* victim)
|
||||
}
|
||||
}
|
||||
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackType attType) const
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackType attType) const
|
||||
{
|
||||
// This is only wrapper
|
||||
|
||||
@@ -2488,7 +2488,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy
|
||||
return RollMeleeOutcomeAgainst(victim, attType, int32(crit_chance * 100), int32(miss_chance * 100), int32(dodge_chance * 100), int32(parry_chance * 100), int32(block_chance * 100));
|
||||
}
|
||||
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
|
||||
MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks())
|
||||
{
|
||||
@@ -2791,7 +2791,7 @@ bool Unit::isBlockCritical()
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 Unit::GetMechanicResistChance(const SpellInfo* spell)
|
||||
int32 Unit::GetMechanicResistChance(SpellInfo const* spell)
|
||||
{
|
||||
if (!spell)
|
||||
return 0;
|
||||
@@ -3285,7 +3285,7 @@ float Unit::GetUnitBlockChance() const
|
||||
}
|
||||
}
|
||||
|
||||
float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const
|
||||
float Unit::GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victim) const
|
||||
{
|
||||
float crit;
|
||||
|
||||
@@ -4052,7 +4052,7 @@ void Unit::_ApplyAura(AuraApplication* aurApp, uint8 effMask)
|
||||
Unit* caster = aura->GetCaster();
|
||||
|
||||
// Update target aura state flag
|
||||
const SpellInfo* spellInfo = aura->GetSpellInfo();
|
||||
SpellInfo const* spellInfo = aura->GetSpellInfo();
|
||||
if (AuraStateType aState = spellInfo->GetAuraState())
|
||||
{
|
||||
if (aState != AURA_STATE_CONFLAGRATE)
|
||||
@@ -9504,7 +9504,7 @@ void Unit::setPowerType(Powers new_powertype)
|
||||
break;
|
||||
}
|
||||
|
||||
if (const Player* player = ToPlayer())
|
||||
if (Player const* player = ToPlayer())
|
||||
if (player->NeedSendSpectatorData())
|
||||
{
|
||||
ArenaSpectator::SendCommand_UInt32Value(FindMap(), GetGUID(), "PWT", new_powertype);
|
||||
@@ -12721,7 +12721,7 @@ void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply,
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply)
|
||||
void Unit::ApplySpellDispelImmunity(SpellInfo const* spellProto, DispelType type, bool apply)
|
||||
{
|
||||
ApplySpellImmune(spellProto->Id, IMMUNITY_DISPEL, type, apply);
|
||||
|
||||
@@ -12756,7 +12756,7 @@ float Unit::GetWeaponProcChance() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const
|
||||
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const* spellProto) const
|
||||
{
|
||||
// proc per minute chance calculation
|
||||
if (PPM <= 0)
|
||||
@@ -13216,7 +13216,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
repTargetToThis <= REP_NEUTRAL)
|
||||
{
|
||||
Player* owner = GetAffectingPlayer();
|
||||
const Unit* const thisUnit = owner ? owner : this;
|
||||
Unit const* const thisUnit = owner ? owner : this;
|
||||
if (!(target->GetTypeId() == TYPEID_PLAYER && thisUnit->GetTypeId() == TYPEID_PLAYER) &&
|
||||
!(target->GetTypeId() == TYPEID_UNIT && thisUnit->GetTypeId() == TYPEID_UNIT))
|
||||
{
|
||||
@@ -13489,7 +13489,7 @@ bool Unit::IsAlwaysDetectableFor(WorldObject const* seer) const
|
||||
return true;
|
||||
|
||||
if (Player* ownerPlayer = GetSpellModOwner())
|
||||
if (const Player* seerPlayer = seer->ToPlayer())
|
||||
if (Player const* seerPlayer = seer->ToPlayer())
|
||||
{
|
||||
if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
|
||||
return true;
|
||||
@@ -15389,7 +15389,7 @@ bool InitTriggerAuraData()
|
||||
return true;
|
||||
}
|
||||
|
||||
void createProcFlags(const SpellInfo* spellInfo, WeaponAttackType attackType, bool positive, uint32& procAttacker, uint32& procVictim)
|
||||
void createProcFlags(SpellInfo const* spellInfo, WeaponAttackType attackType, bool positive, uint32& procAttacker, uint32& procVictim)
|
||||
{
|
||||
if (spellInfo)
|
||||
{
|
||||
@@ -18132,8 +18132,8 @@ bool Unit::IsInPartyWith(Unit const* unit) const
|
||||
if (this == unit)
|
||||
return true;
|
||||
|
||||
const Unit* u1 = GetCharmerOrOwnerOrSelf();
|
||||
const Unit* u2 = unit->GetCharmerOrOwnerOrSelf();
|
||||
Unit const* u1 = GetCharmerOrOwnerOrSelf();
|
||||
Unit const* u2 = unit->GetCharmerOrOwnerOrSelf();
|
||||
if (u1 == u2)
|
||||
return true;
|
||||
|
||||
@@ -18155,8 +18155,8 @@ bool Unit::IsInRaidWith(Unit const* unit) const
|
||||
if (this == unit)
|
||||
return true;
|
||||
|
||||
const Unit* u1 = GetCharmerOrOwnerOrSelf();
|
||||
const Unit* u2 = unit->GetCharmerOrOwnerOrSelf();
|
||||
Unit const* u1 = GetCharmerOrOwnerOrSelf();
|
||||
Unit const* u2 = unit->GetCharmerOrOwnerOrSelf();
|
||||
if (u1 == u2)
|
||||
return true;
|
||||
|
||||
@@ -18341,7 +18341,7 @@ void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool
|
||||
|
||||
// Melee based spells can be miss, parry or dodge on this step
|
||||
// Crit or block - determined on damage calculation phase! (and can be both in some time)
|
||||
float Unit::MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
|
||||
float Unit::MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
|
||||
{
|
||||
SpellInfo const* spellInfo = spellId ? sSpellMgr->GetSpellInfo(spellId) : nullptr;
|
||||
if (spellInfo && spellInfo->HasAttribute(SPELL_ATTR7_NO_ATTACK_MISS))
|
||||
@@ -19680,7 +19680,7 @@ bool CharmInfo::IsReturning()
|
||||
return _isReturning;
|
||||
}
|
||||
|
||||
void Unit::PetSpellFail(const SpellInfo* spellInfo, Unit* target, uint32 result)
|
||||
void Unit::PetSpellFail(SpellInfo const* spellInfo, Unit* target, uint32 result)
|
||||
{
|
||||
CharmInfo* charmInfo = GetCharmInfo();
|
||||
if (!charmInfo || GetTypeId() != TYPEID_UNIT)
|
||||
|
||||
@@ -905,7 +905,7 @@ struct SpellPeriodicAuraLogInfo
|
||||
bool critical;
|
||||
};
|
||||
|
||||
void createProcFlags(const SpellInfo* spellInfo, WeaponAttackType attackType, bool positive, uint32& procAttacker, uint32& procVictim);
|
||||
void createProcFlags(SpellInfo const* spellInfo, WeaponAttackType attackType, bool positive, uint32& procAttacker, uint32& procVictim);
|
||||
uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition);
|
||||
|
||||
struct RedirectThreatInfo
|
||||
@@ -1308,10 +1308,10 @@ public:
|
||||
[[nodiscard]] float GetCombatReach() const override { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
|
||||
[[nodiscard]] float GetMeleeReach() const { float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; }
|
||||
[[nodiscard]] bool IsWithinRange(Unit const* obj, float dist) const;
|
||||
bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
|
||||
bool IsWithinMeleeRange(const Unit* obj, float dist = 0.f) const;
|
||||
bool IsWithinCombatRange(Unit const* obj, float dist2compare) const;
|
||||
bool IsWithinMeleeRange(Unit const* obj, float dist = 0.f) const;
|
||||
float GetMeleeRange(Unit const* target) const;
|
||||
bool GetRandomContactPoint(const Unit* target, float& x, float& y, float& z, bool force = false) const;
|
||||
bool GetRandomContactPoint(Unit const* target, float& x, float& y, float& z, bool force = false) const;
|
||||
uint32 m_extraAttacks;
|
||||
bool m_canDualWield;
|
||||
|
||||
@@ -1524,9 +1524,9 @@ public:
|
||||
[[nodiscard]] uint32 GetRangedDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_RANGED, 2.0f, 100.0f, damage); }
|
||||
[[nodiscard]] uint32 GetSpellDamageReduction(uint32 damage) const { return GetCombatRatingDamageReduction(CR_CRIT_TAKEN_SPELL, 2.0f, 100.0f, damage); }
|
||||
|
||||
static void ApplyResilience(const Unit* victim, float* crit, int32* damage, bool isCrit, CombatRating type);
|
||||
static void ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type);
|
||||
|
||||
float MeleeSpellMissChance(const Unit* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
|
||||
float MeleeSpellMissChance(Unit const* victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
|
||||
SpellMissInfo MeleeSpellHitResult(Unit* victim, SpellInfo const* spell);
|
||||
SpellMissInfo MagicSpellHitResult(Unit* victim, SpellInfo const* spell);
|
||||
SpellMissInfo SpellHitResult(Unit* victim, SpellInfo const* spell, bool canReflect = false);
|
||||
@@ -1535,8 +1535,8 @@ public:
|
||||
[[nodiscard]] float GetUnitParryChance() const;
|
||||
[[nodiscard]] float GetUnitBlockChance() const;
|
||||
[[nodiscard]] float GetUnitMissChance(WeaponAttackType attType) const;
|
||||
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* victim) const;
|
||||
int32 GetMechanicResistChance(const SpellInfo* spell);
|
||||
float GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victim) const;
|
||||
int32 GetMechanicResistChance(SpellInfo const* spell);
|
||||
[[nodiscard]] bool CanUseAttackType(uint8 attacktype) const
|
||||
{
|
||||
switch (attacktype)
|
||||
@@ -1570,10 +1570,10 @@ public:
|
||||
uint32 GetDefenseSkillValue(Unit const* target = nullptr) const;
|
||||
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = nullptr) const;
|
||||
[[nodiscard]] float GetWeaponProcChance() const;
|
||||
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
|
||||
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const* spellProto) const;
|
||||
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType) const;
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const* victim, WeaponAttackType attType) const;
|
||||
MeleeHitOutcome RollMeleeOutcomeAgainst (Unit const* victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
|
||||
|
||||
[[nodiscard]] bool IsVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
|
||||
[[nodiscard]] bool IsTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
|
||||
@@ -2147,7 +2147,7 @@ public:
|
||||
void CastDelayedSpellWithPeriodicAmount(Unit* caster, uint32 spellId, AuraType auraType, int32 addAmount, uint8 effectIndex = 0);
|
||||
|
||||
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType = SPELL_BLOCK_TYPE_ALL);
|
||||
void ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply);
|
||||
void ApplySpellDispelImmunity(SpellInfo const* spellProto, DispelType type, bool apply);
|
||||
virtual bool IsImmunedToSpell(SpellInfo const* spellInfo);
|
||||
// redefined in Creature
|
||||
[[nodiscard]] bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const;
|
||||
@@ -2272,7 +2272,7 @@ public:
|
||||
void RemoveVehicleKit();
|
||||
[[nodiscard]] Vehicle* GetVehicleKit()const { return m_vehicleKit; }
|
||||
[[nodiscard]] Vehicle* GetVehicle() const { return m_vehicle; }
|
||||
bool IsOnVehicle(const Unit* vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
|
||||
bool IsOnVehicle(Unit const* vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
|
||||
[[nodiscard]] Unit* GetVehicleBase() const;
|
||||
[[nodiscard]] Creature* GetVehicleCreatureBase() const;
|
||||
[[nodiscard]] ObjectGuid GetTransGUID() const override;
|
||||
@@ -2346,7 +2346,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool CanApplyResilience() const { return m_applyResilience; }
|
||||
|
||||
void PetSpellFail(const SpellInfo* spellInfo, Unit* target, uint32 result);
|
||||
void PetSpellFail(SpellInfo const* spellInfo, Unit* target, uint32 result);
|
||||
|
||||
int32 CalculateAOEDamageReduction(int32 damage, uint32 schoolMask, Unit* caster) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user