diff options
author | megamage <none@none> | 2009-08-27 13:54:57 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-27 13:54:57 -0500 |
commit | d91903e5b1b2ffac46fa8a0129e98ffcaaa95aa1 (patch) | |
tree | 4e0d2b8e7fa0bee1317ef322145b8add40aa4abd /src/game/Creature.cpp | |
parent | 72c18a735408254aaf676208750a3c2073e49ea2 (diff) |
*Fix the behavior of mob assistance.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 3e857a34acc..6b018a6254f 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1706,8 +1706,16 @@ bool Creature::canStartAttack(Unit const* who, bool force) const // TODO: should switch to range attack return false; - if(!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) - return false; + if(!force) + { + if(who->isInCombat()) + if(Unit *victim = who->getAttackerForHelper()) + if(IsWithinDistInMap(victim, sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))) + force = true; + + if(!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) + return false; + } if(!canCreatureAttack(who, force)) return false; |