diff options
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 226fd7083b..a01c64b1a9 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -58,8 +58,8 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN return; } - // Xinef: Skip creatures in evade mode - if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim() && !creature->IsInEvadeMode()) + // Xinef: Skip creatures in evade mode + if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim() && !creature->IsInEvadeMode()) { if (Unit* nearTarget = creature->SelectNearestTarget(maxRangeToNearestTarget)) creature->AI()->AttackStart(nearTarget); @@ -128,12 +128,12 @@ void CreatureAI::MoveInLineOfSight(Unit* who) if (me->GetVictim()) return; - // pussywizard: civilian, non-combat pet or any other NOT HOSTILE TO ANYONE (!) - if (me->IsMoveInLineOfSightDisabled()) - if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET || // nothing more to do, return - !who->IsInCombat() || // if not in combat, nothing more to do - !me->IsWithinDist(who, ATTACK_DISTANCE)) // if in combat and in dist - neutral to all can actually assist other creatures - return; + // pussywizard: civilian, non-combat pet or any other NOT HOSTILE TO ANYONE (!) + if (me->IsMoveInLineOfSightDisabled()) + if (me->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET || // nothing more to do, return + !who->IsInCombat() || // if not in combat, nothing more to do + !me->IsWithinDist(who, ATTACK_DISTANCE)) // if in combat and in dist - neutral to all can actually assist other creatures + return; if (me->CanStartAttack(who)) AttackStart(who); @@ -212,9 +212,9 @@ bool CreatureAI::UpdateVictim() AttackStart(victim); return me->GetVictim(); } - // xinef: if we have any victim, just return true - else if (me->GetVictim() && me->GetExactDist(me->GetVictim()) < 30.0f) - return true; + // xinef: if we have any victim, just return true + else if (me->GetVictim() && me->GetExactDist(me->GetVictim()) < 30.0f) + return true; else if (me->getThreatManager().isThreatListEmpty()) { EnterEvadeMode(); |