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

@@ -698,7 +698,7 @@ void SmartAI::MoveInLineOfSight(Unit* who)
}
}
bool SmartAI::CanAIAttack(const Unit* /*who*/) const
bool SmartAI::CanAIAttack(Unit const* /*who*/) const
{
if (me->GetReactState() == REACT_PASSIVE)
return false;
@@ -754,7 +754,7 @@ void SmartAI::JustRespawned()
mFollowArrivedAlive = true;
}
int SmartAI::Permissible(const Creature* creature)
int SmartAI::Permissible(Creature const* creature)
{
if (creature->GetAIName() == "SmartAI")
return PERMIT_BASE_SPECIAL;
@@ -832,12 +832,12 @@ void SmartAI::AttackStart(Unit* who)
}
}
void SmartAI::SpellHit(Unit* unit, const SpellInfo* spellInfo)
void SmartAI::SpellHit(Unit* unit, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
}
void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
void SmartAI::SpellHitTarget(Unit* target, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT_TARGET, target, 0, 0, false, spellInfo);
}
@@ -1101,7 +1101,7 @@ void SmartGameObjectAI::SummonedCreatureDies(Creature* summon, Unit* /*killer*/)
GetScript()->ProcessEventsFor(SMART_EVENT_SUMMONED_UNIT_DIES, summon);
}
int SmartGameObjectAI::Permissible(const GameObject* g)
int SmartGameObjectAI::Permissible(GameObject const* g)
{
if (g->GetAIName() == "SmartGameObjectAI")
return PERMIT_BASE_SPECIAL;
@@ -1199,7 +1199,7 @@ void SmartGameObjectAI::EventInform(uint32 eventId)
GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, nullptr, eventId);
}
void SmartGameObjectAI::SpellHit(Unit* unit, const SpellInfo* spellInfo)
void SmartGameObjectAI::SpellHit(Unit* unit, SpellInfo const* spellInfo)
{
GetScript()->ProcessEventsFor(SMART_EVENT_SPELLHIT, unit, 0, 0, false, spellInfo);
}

View File

@@ -101,10 +101,10 @@ public:
void MoveInLineOfSight(Unit* who) override;
// Called when hit by a spell
void SpellHit(Unit* unit, const SpellInfo* spellInfo) override;
void SpellHit(Unit* unit, SpellInfo const* spellInfo) override;
// Called when spell hits a target
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override;
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override;
// Called at any Damage from any attacker (before damage apply)
void DamageTaken(Unit* done_by, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override;
@@ -146,7 +146,7 @@ public:
void OnCharmed(bool apply) override;
// Called when victim is in line of sight
bool CanAIAttack(const Unit* who) const override;
bool CanAIAttack(Unit const* who) const override;
// Used in scripts to share variables
void DoAction(int32 param = 0) override;
@@ -164,7 +164,7 @@ public:
ObjectGuid GetGUID(int32 id = 0) const override;
//core related
static int32 Permissible(const Creature*);
static int32 Permissible(Creature const*);
// Called at movepoint reached
void MovepointReached(uint32 id);
@@ -258,7 +258,7 @@ public:
void InitializeAI() override;
void Reset() override;
SmartScript* GetScript() { return &mScript; }
static int32 Permissible(const GameObject* g);
static int32 Permissible(GameObject const* g);
bool GossipHello(Player* player, bool reportUse) override;
bool GossipSelect(Player* player, uint32 sender, uint32 action) override;
@@ -271,7 +271,7 @@ public:
void OnGameEvent(bool start, uint16 eventId) override;
void OnStateChanged(uint32 state, Unit* unit) override;
void EventInform(uint32 eventId) override;
void SpellHit(Unit* unit, const SpellInfo* spellInfo) override;
void SpellHit(Unit* unit, SpellInfo const* spellInfo) override;
// Called when a summoned unit dies
void SummonedCreatureDies(Creature* summon, Unit* killer) override;

View File

@@ -97,7 +97,7 @@ void SmartScript::OnReset()
RestoreCasterMaxDist();
}
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob)
{
for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i)
{
@@ -116,7 +116,7 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3
}
}
void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob)
{
//calc random
if (e.GetEventType() != SMART_EVENT_LINK && e.event.event_chance < 100 && e.event.event_chance)
@@ -3410,7 +3410,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
}
void SmartScript::ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
void SmartScript::ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob)
{
// xinef: extended by selfs victim
ConditionList const conds = sConditionMgr->GetConditionsForSmartEvent(e.entryOrGuid, e.event_id, e.source_type);
@@ -4016,7 +4016,7 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist)
return targets;
}
void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob)
{
if (!e.active && e.GetEventType() != SMART_EVENT_LINK)
return;
@@ -4928,7 +4928,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTrigger const* at)
// Xinef: if smartcast combat move flag is present
if (i->GetActionType() == SMART_ACTION_CAST && (i->action.cast.flags & SMARTCAST_COMBAT_MOVE))
{
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(i->action.cast.spell))
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i->action.cast.spell))
{
float maxRange = spellInfo->GetMaxRange(spellInfo->IsPositive());
float minRange = spellInfo->GetMinRange(spellInfo->IsPositive());

View File

@@ -36,14 +36,14 @@ public:
void GetScript();
void FillScript(SmartAIEventList e, WorldObject* obj, AreaTrigger const* at);
void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
bool CheckTimer(SmartScriptHolder const& e) const;
void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max);
void UpdateTimer(SmartScriptHolder& e, uint32 const diff);
void InitTimer(SmartScriptHolder& e);
void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr);
void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, SpellInfo const* spell = nullptr, GameObject* gob = nullptr);
ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = nullptr);
ObjectList* GetWorldObjectsInDist(float dist);
void InstallTemplate(SmartScriptHolder const& e);