diff options
author | Machiavelli <none@none> | 2009-06-15 23:59:27 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-06-15 23:59:27 +0200 |
commit | ef28e35c893f78f6c5a5bd069dc815b33d4ba8c6 (patch) | |
tree | f4a93967c000a5a84d1668705a7d48011c9a0ef5 /src/game/Creature.cpp | |
parent | 6ad7da569c51d6c62b707f6c436efb4275daf1b9 (diff) | |
parent | 9edc94f0922eba48148fec85bf02773c80537978 (diff) |
*Merge
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index bfa185010fd..24fd970bddf 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1648,9 +1648,13 @@ bool Creature::IsWithinSightDist(Unit const* u) const bool Creature::canStartAttack(Unit const* who, bool force) const { - if(isCivilian() - || !who->isInAccessiblePlaceFor(this) - || !canFly() && GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + if(isCivilian() || !who->isInAccessiblePlaceFor(this)) + return false; + + if(!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)) + //|| who->IsControlledByPlayer() && who->IsFlying())) + // we cannot check flying for other creatures, too much map/vmap calculation + // TODO: should switch to range attack return false; if(!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who)))) @@ -2190,6 +2194,9 @@ bool Creature::LoadCreaturesAddon(bool reload) if (cainfo->move_flags != 0) SetUnitMovementFlags(cainfo->move_flags); + if(GetCreatureInfo()->InhabitType & INHABIT_AIR) + AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); + if(cainfo->auras) { for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura) @@ -2504,4 +2511,4 @@ time_t Creature::GetLinkedCreatureRespawnTime() const } return 0; -}
\ No newline at end of file +} |