Core/Creatures: Implemented UNIT_FLAG_PASSIVE

This commit is contained in:
Shauren
2011-03-06 12:22:04 +01:00
parent 222df58340
commit 4b4d3e7450
5 changed files with 19 additions and 20 deletions
@@ -1425,6 +1425,9 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
if (isCivilian())
return false;
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE))
return false;
if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance))
//|| who->IsControlledByPlayer() && who->IsFlying()))
// we cannot check flying for other creatures, too much map/vmap calculation
@@ -1923,6 +1926,9 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
if (isCivilian())
return false;
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE))
return false;
// skip fighting creature
if (isInCombat())
return false;