mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16: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
|
|
@ -47,9 +47,8 @@ AggressorAI::MoveInLineOfSight(Unit *u)
|
|||
if( !m_creature->canFly() && m_creature->GetDistanceZ(u) > CREATURE_Z_ATTACK_RANGE )
|
||||
return;
|
||||
|
||||
if (!m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED) && u->isTargetableForAttack() &&
|
||||
( m_creature->IsHostileTo( u ) /*|| u->getVictim() && m_creature->IsFriendlyTo( u->getVictim() )*/ ) &&
|
||||
u->isInAccessablePlaceFor(m_creature))
|
||||
if (m_creature->CanInitiateAttack() && u->isTargetableForAttack() &&
|
||||
m_creature->IsHostileTo(u) && u->isInAccessablePlaceFor(m_creature))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(u);
|
||||
if(m_creature->IsWithinDistInMap(u, attackRadius) && m_creature->IsWithinLOSInMap(u) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue