mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 22:15:15 +00:00
fix(Core/Misc): Change const to be after type name (#10591)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
// AggressorAI
|
||||
/////////////////
|
||||
|
||||
int AggressorAI::Permissible(const Creature* creature)
|
||||
int AggressorAI::Permissible(Creature const* creature)
|
||||
{
|
||||
// have some hostile factions, it will be selected by IsHostileTo check at MoveInLineOfSight
|
||||
if (!creature->IsCivilian() && !creature->IsNeutralToAll())
|
||||
@@ -226,7 +226,7 @@ TurretAI::TurretAI(Creature* c) : CreatureAI(c)
|
||||
me->m_SightDistance = me->m_CombatDistance;
|
||||
}
|
||||
|
||||
bool TurretAI::CanAIAttack(const Unit* /*who*/) const
|
||||
bool TurretAI::CanAIAttack(Unit const* /*who*/) const
|
||||
{
|
||||
// TODO: use one function to replace it
|
||||
if (!me->IsWithinCombatRange(me->GetVictim(), me->m_CombatDistance)
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
explicit AggressorAI(Creature* c) : CreatureAI(c) {}
|
||||
|
||||
void UpdateAI(uint32) override;
|
||||
static int Permissible(const Creature*);
|
||||
static int Permissible(Creature const*);
|
||||
};
|
||||
|
||||
typedef std::vector<uint32> SpellVct;
|
||||
@@ -83,7 +83,7 @@ struct TurretAI : public CreatureAI
|
||||
{
|
||||
public:
|
||||
explicit TurretAI(Creature* c);
|
||||
bool CanAIAttack(const Unit* who) const override;
|
||||
bool CanAIAttack(Unit const* who) const override;
|
||||
void AttackStart(Unit* who) override;
|
||||
void UpdateAI(uint32 diff) override;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
//GameObjectAI::GameObjectAI(GameObject* g) : go(g) {}
|
||||
int GameObjectAI::Permissible(const GameObject* go)
|
||||
int GameObjectAI::Permissible(GameObject const* go)
|
||||
{
|
||||
if (go->GetAIName() == "GameObjectAI")
|
||||
return PERMIT_BASE_SPECIAL;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
|
||||
virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {}
|
||||
virtual void EventInform(uint32 /*eventId*/) {}
|
||||
virtual void SpellHit(Unit* /*unit*/, const SpellInfo* /*spellInfo*/) {}
|
||||
virtual void SpellHit(Unit* /*unit*/, SpellInfo const* /*spellInfo*/) {}
|
||||
virtual bool CanBeSeen(Player const* /*seer*/) { return true; }
|
||||
|
||||
virtual void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/) { }
|
||||
|
||||
@@ -30,7 +30,7 @@ public:
|
||||
void AttackStart(Unit*) override {}
|
||||
void UpdateAI(uint32) override;
|
||||
|
||||
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
|
||||
static int Permissible(Creature const*) { return PERMIT_BASE_IDLE; }
|
||||
};
|
||||
|
||||
class PossessedAI : public CreatureAI
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
void JustDied(Unit*) override;
|
||||
void KilledUnit(Unit* victim) override;
|
||||
|
||||
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
|
||||
static int Permissible(Creature const*) { return PERMIT_BASE_IDLE; }
|
||||
};
|
||||
|
||||
class NullCreatureAI : public CreatureAI
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
void EnterEvadeMode() override {}
|
||||
void OnCharmed(bool /*apply*/) override {}
|
||||
|
||||
static int Permissible(const Creature*) { return PERMIT_BASE_IDLE; }
|
||||
static int Permissible(Creature const*) { return PERMIT_BASE_IDLE; }
|
||||
};
|
||||
|
||||
class CritterAI : public PassiveAI
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "Util.h"
|
||||
|
||||
int PetAI::Permissible(const Creature* creature)
|
||||
int PetAI::Permissible(Creature const* creature)
|
||||
{
|
||||
if (creature->IsPet())
|
||||
return PERMIT_BASE_SPECIAL;
|
||||
@@ -567,7 +567,7 @@ void PetAI::HandleReturnMovement()
|
||||
me->ClearInPetCombat();
|
||||
}
|
||||
|
||||
void PetAI::SpellHit(Unit* caster, const SpellInfo* spellInfo)
|
||||
void PetAI::SpellHit(Unit* caster, SpellInfo const* spellInfo)
|
||||
{
|
||||
// Xinef: taunt behavior code
|
||||
if (spellInfo->HasAura(SPELL_AURA_MOD_TAUNT) && !me->HasReactState(REACT_PASSIVE))
|
||||
@@ -653,7 +653,7 @@ void PetAI::MovementInform(uint32 moveType, uint32 data)
|
||||
}
|
||||
}
|
||||
|
||||
bool PetAI::CanAttack(Unit* target, const SpellInfo* spellInfo)
|
||||
bool PetAI::CanAttack(Unit* target, SpellInfo const* spellInfo)
|
||||
{
|
||||
// Evaluates wether a pet can attack a specific target based on CommandState, ReactState and other flags
|
||||
// IMPORTANT: The order in which things are checked is important, be careful if you add or remove checks
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
explicit PetAI(Creature* c);
|
||||
|
||||
void UpdateAI(uint32) override;
|
||||
static int Permissible(const Creature*);
|
||||
static int Permissible(Creature const*);
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override;
|
||||
void AttackStart(Unit* target) override;
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* /*who*/) override {} // CreatureAI interferes with returning pets
|
||||
void MoveInLineOfSight_Safe(Unit* /*who*/) {} // CreatureAI interferes with returning pets
|
||||
void EnterEvadeMode() override {} // For fleeing, pets don't use this type of Evade mechanic
|
||||
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override;
|
||||
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override;
|
||||
|
||||
void PetStopAttack() override;
|
||||
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
Unit* SelectNextTarget(bool allowAutoSelect) const;
|
||||
void HandleReturnMovement();
|
||||
void DoAttack(Unit* target, bool chase);
|
||||
bool CanAttack(Unit* target, const SpellInfo* spellInfo = nullptr);
|
||||
bool CanAttack(Unit* target, SpellInfo const* spellInfo = nullptr);
|
||||
void ClearCharmInfoFlags();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "CreatureAIImpl.h"
|
||||
#include "Errors.h"
|
||||
|
||||
int ReactorAI::Permissible(const Creature* creature)
|
||||
int ReactorAI::Permissible(Creature const* creature)
|
||||
{
|
||||
if (creature->IsCivilian() || creature->IsNeutralToAll())
|
||||
return PERMIT_BASE_REACTIVE;
|
||||
|
||||
@@ -30,6 +30,6 @@ public:
|
||||
void MoveInLineOfSight(Unit*) override {}
|
||||
void UpdateAI(uint32 diff) override;
|
||||
|
||||
static int Permissible(const Creature*);
|
||||
static int Permissible(Creature const*);
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ TotemAI::TotemAI(Creature* c) : CreatureAI(c)
|
||||
ASSERT(c->IsTotem());
|
||||
}
|
||||
|
||||
void TotemAI::SpellHit(Unit* /*caster*/, const SpellInfo* /*spellInfo*/)
|
||||
void TotemAI::SpellHit(Unit* /*caster*/, SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* who) override;
|
||||
void AttackStart(Unit* victim) override;
|
||||
void EnterEvadeMode() override;
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* /*spellInfo*/) override;
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* /*spellInfo*/) override;
|
||||
void DoAction(int32 param) override;
|
||||
|
||||
void UpdateAI(uint32 diff) override;
|
||||
|
||||
@@ -149,7 +149,7 @@ void UnitAI::DoCast(uint32 spellId)
|
||||
break;
|
||||
case AITARGET_ENEMY:
|
||||
{
|
||||
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
bool playerOnly = spellInfo->HasAttribute(SPELL_ATTR3_ONLY_ON_PLAYER);
|
||||
//float range = GetSpellMaxRange(spellInfo, false);
|
||||
target = SelectTarget(SelectTargetMethod::Random, 0, spellInfo->GetMaxRange(false), playerOnly);
|
||||
@@ -163,7 +163,7 @@ void UnitAI::DoCast(uint32 spellId)
|
||||
break;
|
||||
case AITARGET_DEBUFF:
|
||||
{
|
||||
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
bool playerOnly = spellInfo->HasAttribute(SPELL_ATTR3_ONLY_ON_PLAYER);
|
||||
float range = spellInfo->GetMaxRange(false);
|
||||
|
||||
@@ -225,7 +225,7 @@ void UnitAI::FillAISpellInfo()
|
||||
AISpellInfo = new AISpellInfoType[sSpellMgr->GetSpellInfoStoreSize()];
|
||||
|
||||
AISpellInfoType* AIInfo = AISpellInfo;
|
||||
const SpellInfo* spellInfo;
|
||||
SpellInfo const* spellInfo;
|
||||
|
||||
for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i, ++AIInfo)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ enum class SelectTargetMethod
|
||||
// default predicate function to select target based on distance, player and/or aura criteria
|
||||
struct DefaultTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
{
|
||||
const Unit* me;
|
||||
Unit const* me;
|
||||
float m_dist;
|
||||
bool m_playerOnly;
|
||||
int32 m_aura;
|
||||
@@ -167,7 +167,7 @@ struct FarthestTargetSelector : public Acore::unary_function<Unit*, bool>
|
||||
}
|
||||
|
||||
private:
|
||||
const Unit* _me;
|
||||
Unit const* _me;
|
||||
float _dist;
|
||||
bool _playerOnly;
|
||||
bool _inLos;
|
||||
|
||||
Reference in New Issue
Block a user