fix(Core/Misc): Change const to be after type name (#10591)

This commit is contained in:
Kitzunu
2022-02-14 20:05:45 +01:00
committed by GitHub
parent 9b83abca39
commit 455899dc75
168 changed files with 438 additions and 438 deletions

View File

@@ -2415,7 +2415,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
{
if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID())
{
const SpellInfo* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
SpellInfo const* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->GetTypeId() == TYPEID_UNIT)
{
Creature* c = (*iter)->ToCreature();

View File

@@ -287,7 +287,7 @@ void AuraApplication::ClientUpdate(bool remove)
BuildUpdatePacket(data, remove);
if (GetSlot() < MAX_AURAS)
if (const Player* plr = GetTarget()->ToPlayer())
if (Player const* plr = GetTarget()->ToPlayer())
if (Aura* aura = GetBase())
if (plr->NeedSendSpectatorData() && ArenaSpectator::ShouldSendAura(aura, GetEffectMask(), GetTarget()->GetGUID(), remove))
ArenaSpectator::SendCommand_Aura(plr->FindMap(), plr->GetGUID(), "AUR", aura->GetCasterGUID(), aura->GetSpellInfo()->Id, aura->GetSpellInfo()->IsPositive(), aura->GetSpellInfo()->Dispel, aura->GetDuration(), aura->GetMaxDuration(), (aura->GetCharges() > 1 ? aura->GetCharges() : aura->GetStackAmount()), remove);

View File

@@ -5334,7 +5334,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// Spectator check
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if (((const Player*)m_caster)->IsSpectator() && m_spellInfo->Id != SPECTATOR_SPELL_BINDSIGHT)
if (((Player const*)m_caster)->IsSpectator() && m_spellInfo->Id != SPECTATOR_SPELL_BINDSIGHT)
return SPELL_FAILED_NOT_HERE;
SpellCastResult res = SPELL_CAST_OK;

View File

@@ -839,13 +839,13 @@ typedef void(Spell::*pEffect)(SpellEffIndex effIndex);
class ReflectEvent : public BasicEvent
{
public:
ReflectEvent(Unit* caster, ObjectGuid targetGUID, const SpellInfo* spellInfo) : _caster(caster), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
ReflectEvent(Unit* caster, ObjectGuid targetGUID, SpellInfo const* spellInfo) : _caster(caster), _targetGUID(targetGUID), _spellInfo(spellInfo) { }
bool Execute(uint64 e_time, uint32 p_time) override;
protected:
Unit* _caster;
ObjectGuid _targetGUID;
const SpellInfo* _spellInfo;
SpellInfo const* _spellInfo;
};
#endif

View File

@@ -4279,7 +4279,7 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
{
if ((*iter)->GetCurrentSpell(i) && (*iter)->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == unitTarget->GetGUID())
{
const SpellInfo* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
SpellInfo const* si = (*iter)->GetCurrentSpell(i)->GetSpellInfo();
if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->GetTypeId() == TYPEID_UNIT)
{
Creature* c = (*iter)->ToCreature();
@@ -4968,7 +4968,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
{
if (spell->m_targets.GetUnitTargetGUID() == m_caster->GetGUID())
{
const SpellInfo* si = spell->GetSpellInfo();
SpellInfo const* si = spell->GetSpellInfo();
if (si->HasAttribute(SPELL_ATTR6_IGNORE_PHASE_SHIFT) && (*iter)->GetTypeId() == TYPEID_UNIT)
{
Creature* c = (*iter)->ToCreature();

View File

@@ -1725,7 +1725,7 @@ bool SpellInfo::IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const
return matchCount * 2 == auraCount;
}
bool SpellInfo::ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const
bool SpellInfo::ValidateAttribute6SpellDamageMods(Unit const* caster, const AuraEffect* auraEffect, bool isDot) const
{
// Xinef: no attribute
if (!(AttributesEx6 & SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS))
@@ -1735,7 +1735,7 @@ bool SpellInfo::ValidateAttribute6SpellDamageMods(const Unit* caster, const Aura
// Xinef: Scourge Strike - Trigger
if (Id == 70890 && auraEffect)
{
const SpellInfo* auraInfo = auraEffect->GetSpellInfo();
SpellInfo const* auraInfo = auraEffect->GetSpellInfo();
return auraInfo->SpellIconID == 3086 ||
(auraInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (auraInfo->SpellFamilyFlags & flag96(8388608, 64, 16) || auraInfo->SpellIconID == 235 || auraInfo->SpellIconID == 154));
}

View File

@@ -481,7 +481,7 @@ public:
// xinef: aura stacking
bool IsStrongerAuraActive(Unit const* caster, Unit const* target) const;
bool IsAuraEffectEqual(SpellInfo const* otherSpellInfo) const;
bool ValidateAttribute6SpellDamageMods(const Unit* caster, const AuraEffect* auraEffect, bool isDot) const;
bool ValidateAttribute6SpellDamageMods(Unit const* caster, const AuraEffect* auraEffect, bool isDot) const;
SpellSchoolMask GetSchoolMask() const;
uint32 GetAllEffectsMechanicMask() const;

View File

@@ -2853,10 +2853,10 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
for (uint8 j = 0; j < MAX_TALENT_RANK; j++)
if (uint32 spellId = talentInfo->RankID[j])
if (const SpellInfo* spellInfo = GetSpellInfo(spellId))
if (SpellInfo const* spellInfo = GetSpellInfo(spellId))
for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
if (spellInfo->Effects[k].Effect == SPELL_EFFECT_LEARN_SPELL)
if (const SpellInfo* learnSpell = GetSpellInfo(spellInfo->Effects[k].TriggerSpell))
if (SpellInfo const* learnSpell = GetSpellInfo(spellInfo->Effects[k].TriggerSpell))
if (learnSpell->IsRanked() && !learnSpell->HasAttribute(SpellAttr0(SPELL_ATTR0_PASSIVE | SPELL_ATTR0_DO_NOT_DISPLAY)))
mTalentSpellAdditionalSet.insert(learnSpell->Id);
}