converted all tabs to 4 spaces

This commit is contained in:
Yehonal
2016-06-26 19:23:57 +02:00
parent 52f305111c
commit f6eefedcd5
717 changed files with 132388 additions and 132388 deletions

View File

@@ -90,7 +90,7 @@ bool SummonList::HasEntry(uint32 entry) const
uint32 SummonList::GetEntryCount(uint32 entry) const
{
uint32 count = 0;
uint32 count = 0;
for (StorageType::const_iterator i = storage_.begin(); i != storage_.end(); ++i)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
@@ -106,10 +106,10 @@ void SummonList::Respawn()
for (StorageType::iterator i = storage_.begin(); i != storage_.end();)
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
{
summon->Respawn(true);
{
summon->Respawn(true);
++i;
}
}
else
i = storage_.erase(i);
}
@@ -120,8 +120,8 @@ Creature* SummonList::GetCreatureWithEntry(uint32 entry) const
for (StorageType::const_iterator i = storage_.begin(); i != storage_.end(); ++i)
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
if (summon->GetEntry() == entry)
return summon;
if (summon->GetEntry() == entry)
return summon;
}
return NULL;
@@ -296,7 +296,7 @@ void ScriptedAI::DoResetThreat()
return;
}
me->getThreatManager().resetAllAggro();
me->getThreatManager().resetAllAggro();
}
float ScriptedAI::DoGetThreat(Unit* unit)
@@ -410,20 +410,20 @@ enum eNPCs
NPC_BROODLORD = 12017,
NPC_JAN_ALAI = 23578,
NPC_SARTHARION = 28860,
NPC_FREYA = 32906,
NPC_FREYA = 32906,
};
bool ScriptedAI::EnterEvadeIfOutOfCombatArea()
{
if (me->IsInEvadeMode() || !me->IsInCombat())
if (me->IsInEvadeMode() || !me->IsInCombat())
return false;
if (_evadeCheckCooldown == time(NULL))
return false;
_evadeCheckCooldown = time(NULL);
if (_evadeCheckCooldown == time(NULL))
return false;
_evadeCheckCooldown = time(NULL);
if (!CheckEvadeIfOutOfCombatArea())
return false;
if (!CheckEvadeIfOutOfCombatArea())
return false;
EnterEvadeMode();
return true;
@@ -431,22 +431,22 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea()
Player* ScriptedAI::SelectTargetFromPlayerList(float maxdist, uint32 excludeAura, bool mustBeInLOS) const
{
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
std::vector<Player*> tList;
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
{
if (me->GetDistance(itr->GetSource()) > maxdist || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
continue;
if (excludeAura && itr->GetSource()->HasAura(excludeAura))
continue;
if (mustBeInLOS && !me->IsWithinLOSInMap(itr->GetSource()))
continue;
tList.push_back(itr->GetSource());
}
if (!tList.empty())
return tList[urand(0,tList.size()-1)];
else
return NULL;
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
std::vector<Player*> tList;
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
{
if (me->GetDistance(itr->GetSource()) > maxdist || !itr->GetSource()->IsAlive() || itr->GetSource()->IsGameMaster())
continue;
if (excludeAura && itr->GetSource()->HasAura(excludeAura))
continue;
if (mustBeInLOS && !me->IsWithinLOSInMap(itr->GetSource()))
continue;
tList.push_back(itr->GetSource());
}
if (!tList.empty())
return tList[urand(0,tList.size()-1)];
else
return NULL;
}
// BossAI - for instanced bosses

View File

@@ -79,10 +79,10 @@ public:
return storage_.size();
}
void clear()
{
storage_.clear();
}
void clear()
{
storage_.clear();
}
void Summon(Creature const* summon) { storage_.push_back(summon->GetGUID()); }
void Despawn(Creature const* summon) { storage_.remove(summon->GetGUID()); }
@@ -100,7 +100,7 @@ public:
if (max)
RemoveNotExisting(); // pussywizard: when max is set, non existing can be chosen and nothing will happen
StorageType listCopy = storage_;
StorageType listCopy = storage_;
for (StorageType::const_iterator i = listCopy.begin(); i != listCopy.end(); ++i)
{
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
@@ -135,8 +135,8 @@ public:
void RemoveNotExisting();
bool HasEntry(uint32 entry) const;
uint32 GetEntryCount(uint32 entry) const;
void Respawn();
Creature* GetCreatureWithEntry(uint32 entry) const;
void Respawn();
Creature* GetCreatureWithEntry(uint32 entry) const;
private:
Creature* me;
@@ -159,7 +159,7 @@ class PlayerOrPetCheck
bool operator() (WorldObject* unit) const
{
if (unit->GetTypeId() != TYPEID_PLAYER)
if (!IS_PLAYER_GUID(unit->ToUnit()->GetOwnerGUID()))
if (!IS_PLAYER_GUID(unit->ToUnit()->GetOwnerGUID()))
return true;
return false;
@@ -291,7 +291,7 @@ struct ScriptedAI : public CreatureAI
bool IsCombatMovementAllowed() const { return _isCombatMovementAllowed; }
bool EnterEvadeIfOutOfCombatArea();
virtual bool CheckEvadeIfOutOfCombatArea() const { return false; }
virtual bool CheckEvadeIfOutOfCombatArea() const { return false; }
// return true for heroic mode. i.e.
// - for dungeon in mode 10-heroic,
@@ -358,7 +358,7 @@ struct ScriptedAI : public CreatureAI
return heroic25;
}
Player* SelectTargetFromPlayerList(float maxdist, uint32 excludeAura = 0, bool mustBeInLOS = false) const;
Player* SelectTargetFromPlayerList(float maxdist, uint32 excludeAura = 0, bool mustBeInLOS = false) const;
private:
Difficulty _difficulty;

View File

@@ -87,8 +87,8 @@ bool npc_escortAI::AssistPlayerInCombat(Unit* who)
void npc_escortAI::MoveInLineOfSight(Unit* who)
{
if (me->GetVictim())
return;
if (me->GetVictim())
return;
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack(true, me) && who->isInAccessiblePlaceFor(me))
if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who))
@@ -122,7 +122,7 @@ void npc_escortAI::JustDied(Unit* /*killer*/)
void npc_escortAI::JustRespawned()
{
RemoveEscortState(STATE_ESCORT_ESCORTING|STATE_ESCORT_RETURNING|STATE_ESCORT_PAUSED);
RemoveEscortState(STATE_ESCORT_ESCORTING|STATE_ESCORT_RETURNING|STATE_ESCORT_PAUSED);
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
@@ -139,7 +139,7 @@ void npc_escortAI::JustRespawned()
void npc_escortAI::ReturnToLastPoint()
{
float x, y, z, o;
me->SetWalk(false);
me->SetWalk(false);
me->GetHomePosition(x, y, z, o);
me->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z);
}
@@ -213,8 +213,8 @@ void npc_escortAI::UpdateAI(uint32 diff)
me->DespawnOrUnsummon();
}
// xinef: remove escort state, escort was finished (lack of this line resulted in skipping UpdateEscortAI calls after finished escort)
RemoveEscortState(STATE_ESCORT_ESCORTING);
// xinef: remove escort state, escort was finished (lack of this line resulted in skipping UpdateEscortAI calls after finished escort)
RemoveEscortState(STATE_ESCORT_ESCORTING);
return;
}
@@ -239,7 +239,7 @@ void npc_escortAI::UpdateAI(uint32 diff)
//Check if player or any member of his group is within range
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !me->GetVictim() && !HasEscortState(STATE_ESCORT_RETURNING))
{
m_uiPlayerCheckTimer += diff;
m_uiPlayerCheckTimer += diff;
if (m_uiPlayerCheckTimer > 1000)
{
if (DespawnAtFar && !IsPlayerOrGroupInRange())
@@ -303,7 +303,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId)
{
//Call WP function
me->SetPosition(CurrentWP->x, CurrentWP->y, CurrentWP->z, me->GetOrientation());
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
WaypointReached(CurrentWP->id);
m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1;
@@ -495,9 +495,9 @@ bool npc_escortAI::SetNextWaypoint(uint32 pointId, bool setPosition)
size_t const size = WaypointList.size();
Escort_Waypoint waypoint(0, 0, 0, 0, 0);
for (CurrentWP = WaypointList.begin(); CurrentWP != WaypointList.end(); ++CurrentWP)
for (CurrentWP = WaypointList.begin(); CurrentWP != WaypointList.end(); ++CurrentWP)
{
if (CurrentWP->id == pointId)
if (CurrentWP->id == pointId)
{
if (setPosition)
me->UpdatePosition(CurrentWP->x, CurrentWP->y, CurrentWP->z, me->GetOrientation());
@@ -540,7 +540,7 @@ void npc_escortAI::GenerateWaypointArray(Movement::PointsArray* points)
{
// xinef: first point in vector is unit real position
points->clear();
points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
points->push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
for (std::list<Escort_Waypoint>::const_iterator itr = CurrentWP; itr != WaypointList.end(); ++itr)
points->push_back(G3D::Vector3(itr->x, itr->y, itr->z));
}

View File

@@ -35,7 +35,7 @@ void FollowerAI::AttackStart(Unit* who)
if (me->Attack(who, true))
{
// This is done in Unit::Attack function which wont bug npcs by not adding threat upon combat start...
// This is done in Unit::Attack function which wont bug npcs by not adding threat upon combat start...
//me->AddThreat(who, 0.0f);
//me->SetInCombatWith(who);
//who->SetInCombatWith(me);
@@ -80,14 +80,14 @@ bool FollowerAI::AssistPlayerInCombat(Unit* who)
void FollowerAI::MoveInLineOfSight(Unit* who)
{
if (me->GetVictim())
return;
if (me->GetVictim())
return;
if (!me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack(true, me) && who->isInAccessiblePlaceFor(me))
if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who))
return;
if (me->CanStartAttack(who))
if (me->CanStartAttack(who))
AttackStart(who);
}