Core/Cleanup:

Mostly if(.. -> if (.. and for(.. -> for (..
but also some miscellaneous cleanup
This commit is contained in:
kaelima
2012-04-08 23:59:52 +02:00
parent 38d5fbac0e
commit 49e24e2dfb
23 changed files with 63 additions and 84 deletions
+5 -9
View File
@@ -27,8 +27,7 @@
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
int
TotemAI::Permissible(const Creature* creature)
int TotemAI::Permissible(Creature const* creature)
{
if (creature->isTotem())
return PERMIT_BASE_PROACTIVE;
@@ -41,8 +40,7 @@ TotemAI::TotemAI(Creature* c) : CreatureAI(c), i_victimGuid(0)
ASSERT(c->isTotem());
}
void
TotemAI::MoveInLineOfSight(Unit*)
void TotemAI::MoveInLineOfSight(Unit* /*who*/)
{
}
@@ -51,10 +49,9 @@ void TotemAI::EnterEvadeMode()
me->CombatStop(true);
}
void
TotemAI::UpdateAI(const uint32 /*diff*/)
void TotemAI::UpdateAI(uint32 const /*diff*/)
{
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
if (me->ToTotem()->GetTotemType() != TOTEM_ACTIVE)
return;
if (!me->isAlive() || me->IsNonMeleeSpellCasted(false))
@@ -98,8 +95,7 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
i_victimGuid = 0;
}
void
TotemAI::AttackStart(Unit*)
void TotemAI::AttackStart(Unit* /*victim*/)
{
// Sentry totem sends ping on attack
if (me->GetEntry() == SENTRY_TOTEM_ENTRY && me->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+4 -4
View File
@@ -31,12 +31,12 @@ class TotemAI : public CreatureAI
explicit TotemAI(Creature* c);
void MoveInLineOfSight(Unit*);
void AttackStart(Unit*);
void MoveInLineOfSight(Unit* who);
void AttackStart(Unit* victim);
void EnterEvadeMode();
void UpdateAI(const uint32);
static int Permissible(const Creature*);
void UpdateAI(uint32 const diff);
static int Permissible(Creature const* creature);
private:
uint64 i_victimGuid;
+2 -2
View File
@@ -82,7 +82,7 @@ namespace FactorySelector
{
const CreatureAICreator* factory = iter->second;
const SelectableAI* p = dynamic_cast<const SelectableAI*>(factory);
ASSERT(p != NULL);
ASSERT(p);
int val = p->Permit(creature);
if (val > best_val)
{
@@ -102,7 +102,7 @@ namespace FactorySelector
MovementGenerator* selectMovementGenerator(Creature* creature)
{
MovementGeneratorRegistry& mv_registry(*MovementGeneratorRepository::instance());
ASSERT(creature->GetCreatureTemplate() != NULL);
ASSERT(creature->GetCreatureTemplate());
const MovementGeneratorCreator* mv_factory = mv_registry.GetRegistryItem(creature->GetDefaultMovementType());
/* if (mv_factory == NULL)