diff options
author | maximius <none@none> | 2009-09-29 01:16:08 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-09-29 01:16:08 -0700 |
commit | aa5e2d3b2810ed38129254d007e943f155e79111 (patch) | |
tree | 02914d1ca1a0d9075d867d35a906fcfed7331efb /src/game/Unit.cpp | |
parent | 0a9addd224076f0a555535b6b08a342f61d056c8 (diff) |
*The enemy of my enemy is my friend.
*Correct some reversed parameter ordering (team and vehId were swapped)
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1406a048b3a..b7cd49c668b 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11305,7 +11305,7 @@ Unit* Creature::SelectVictim() target = caster; break; } - }while (aura != tauntAuras.begin()); + } while (aura != tauntAuras.begin()); } else target = getVictim(); @@ -11344,7 +11344,7 @@ Unit* Creature::SelectVictim() else return NULL; - if(target && (!target->getVictim() || !target->isAttackingPlayer() || IsFriendlyTo(target->getVictim()))) // if the victim of target is a player, only defend the victim if we are friendly + if(target && (!target->getVictim() || IsFriendlyTo(target->getVictim())) // if victim(1) has a victim(2), only attack victim(1) if we are friendly with victim(2) { SetInFront(target); return target; @@ -11358,7 +11358,7 @@ Unit* Creature::SelectVictim() { if((*itr) && canCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER && !((Creature*)(*itr))->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN) - && (!(*itr)->getVictim() || !(*itr)->isAttackingPlayer() || IsFriendlyTo((*itr)->getVictim()))) // if the victim of target is a player, only defend the victim if we are friendly + // && (!(*itr)->getVictim() || IsFriendlyTo((*itr)->getVictim()))) // if victim(1) has a victim(2), only attack victim(1) if we are friendly with victim(2) return NULL; } @@ -11369,7 +11369,7 @@ Unit* Creature::SelectVictim() // search nearby enemy before enter evade mode if(HasReactState(REACT_AGGRESSIVE)) if(target = SelectNearestTarget()) - if(!target->getVictim() || !target->isAttackingPlayer() || IsFriendlyTo(target->getVictim())) // if the victim of target is a player, only defend the victim if we are friendly + if(!target->getVictim() || IsFriendlyTo(target->getVictim())) // if victim(1) has a victim(2), only attack victim(1) if we are friendly with victim(2) return target; if(m_invisibilityMask) |