Core: Continued cleanup
If and for whitespaces.
This commit is contained in:
@@ -307,7 +307,7 @@ void VehicleAI::LoadConditions()
|
||||
|
||||
void VehicleAI::CheckConditions(const uint32 diff)
|
||||
{
|
||||
if(m_ConditionsTimer < diff)
|
||||
if (m_ConditionsTimer < diff)
|
||||
{
|
||||
if (!conditions.empty())
|
||||
{
|
||||
|
||||
@@ -676,7 +676,7 @@ void WorldBossAI::JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
|
||||
if(target)
|
||||
if (target)
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
|
||||
@@ -215,10 +215,10 @@ void SmartAI::EndPath(bool fail)
|
||||
if (targets->size() == 1 && GetScript()->IsPlayer((*targets->begin())))
|
||||
{
|
||||
Player* plr = (*targets->begin())->ToPlayer();
|
||||
if(!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
|
||||
if (!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
|
||||
plr->GroupEventHappens(mEscortQuestID, me);
|
||||
|
||||
if(fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
if (fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
plr->FailQuest(mEscortQuestID);
|
||||
|
||||
if (Group* pGroup = plr->GetGroup())
|
||||
@@ -227,9 +227,9 @@ void SmartAI::EndPath(bool fail)
|
||||
{
|
||||
Player* pGroupGuy = gr->getSource();
|
||||
|
||||
if(!fail && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse())
|
||||
if (!fail && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse())
|
||||
pGroupGuy->AreaExploredOrEventHappens(mEscortQuestID);
|
||||
if(fail && pGroupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
if (fail && pGroupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
pGroupGuy->FailQuest(mEscortQuestID);
|
||||
}
|
||||
}
|
||||
@@ -240,9 +240,9 @@ void SmartAI::EndPath(bool fail)
|
||||
if (GetScript()->IsPlayer((*iter)))
|
||||
{
|
||||
Player* plr = (*iter)->ToPlayer();
|
||||
if(!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
|
||||
if (!fail && plr->IsAtGroupRewardDistance(me) && !plr->GetCorpse())
|
||||
plr->AreaExploredOrEventHappens(mEscortQuestID);
|
||||
if(fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
if (fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE)
|
||||
plr->FailQuest(mEscortQuestID);
|
||||
}
|
||||
}
|
||||
@@ -374,7 +374,7 @@ void SmartAI::UpdateAI(const uint32 diff)
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if(mCanAutoAttack)
|
||||
if (mCanAutoAttack)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
@@ -934,7 +934,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
return;
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if(!IsUnit((*itr))) continue;
|
||||
if (!IsUnit((*itr)))
|
||||
continue;
|
||||
if (e.action.morphOrMount.creature || e.action.morphOrMount.model)
|
||||
{
|
||||
if (e.action.morphOrMount.creature > 0)
|
||||
@@ -1307,7 +1308,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
{
|
||||
if(Creature* npc = (*itr)->ToCreature())
|
||||
if (Creature* npc = (*itr)->ToCreature())
|
||||
{
|
||||
uint32 slot[3];
|
||||
if (e.action.equip.entry)
|
||||
@@ -1930,7 +1931,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
ObjectList* units = GetWorldObjectsInDist((float)e.target.goRange.maxDist);
|
||||
for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr)
|
||||
{
|
||||
if(!IsGameObject(*itr))
|
||||
if (!IsGameObject(*itr))
|
||||
continue;
|
||||
|
||||
if (go && go == *itr)
|
||||
@@ -2098,13 +2099,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
ProcessAction(e);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_OOC:
|
||||
if(me && me->isInCombat())
|
||||
if (me && me->isInCombat())
|
||||
return;
|
||||
RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
ProcessAction(e);
|
||||
break;
|
||||
case SMART_EVENT_UPDATE_IC:
|
||||
if(!me || !me->isInCombat())
|
||||
if (!me || !me->isInCombat())
|
||||
return;
|
||||
RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax);
|
||||
ProcessAction(e);
|
||||
@@ -2734,7 +2735,7 @@ void SmartScript::OnMoveInLineOfSight(Unit* who)
|
||||
{
|
||||
ProcessEventsFor(SMART_EVENT_OOC_LOS, who);
|
||||
|
||||
if(!me) return;
|
||||
if (!me) return;
|
||||
if (me->getVictim())
|
||||
return;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class SmartScript
|
||||
ObjectList* GetTargetList(uint32 id)
|
||||
{
|
||||
ObjectListMap::iterator itr = mTargetStorage->find(id);
|
||||
if(itr != mTargetStorage->end())
|
||||
if (itr != mTargetStorage->end())
|
||||
return (*itr).second;
|
||||
return NULL;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ class SmartScript
|
||||
private:
|
||||
void IncPhase(int32 p = 1)
|
||||
{
|
||||
if(p >= 0)
|
||||
if (p >= 0)
|
||||
mEventPhase += (uint32)p;
|
||||
else
|
||||
DecPhase(abs(p));
|
||||
|
||||
@@ -1214,7 +1214,7 @@ class SmartAIMgr
|
||||
return mEventMap[uint32(type)][entry];
|
||||
else
|
||||
{
|
||||
if(entry > 0)//first search is for guid (negative), do not drop error if not found
|
||||
if (entry > 0)//first search is for guid (negative), do not drop error if not found
|
||||
sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type));
|
||||
return temp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user