diff options
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; |