mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9603] Implement use of UNIT_FLAG_PASSIVE for creature.
Add function to check creatures own ability to initiate an attack in MoveInLineOfSight. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
a27ff3e79d
commit
bfecdc3ded
6 changed files with 21 additions and 5 deletions
|
|
@ -1022,7 +1022,7 @@ void CreatureEventAI::MoveInLineOfSight(Unit *who)
|
|||
if (m_creature->isCivilian() || m_creature->IsNeutralToAll())
|
||||
return;
|
||||
|
||||
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED) && who->isTargetableForAttack() &&
|
||||
if (m_creature->CanInitiateAttack() && who->isTargetableForAttack() &&
|
||||
m_creature->IsHostileTo(who) && who->isInAccessablePlaceFor(m_creature))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue