Show
Ignore:
Timestamp:
11/21/08 16:54:14 (17 years ago)
Author:
yumileroy
Message:

*Let creature search nearby target before enter evade mode
*Add function canStartAttack to reduce code in MoveInLineOfSight?
*Fix a bug that cancelling bind sight auras may crash the server

Original author: megamage
Date: 2008-11-21 10:07:11-06:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/bindings/scripts/include/sc_creature.cpp

    r257 r267  
    7474void ScriptedAI::MoveInLineOfSight(Unit *who) 
    7575{ 
    76     if(m_creature->getVictim() || !m_creature->IsHostileTo(who) || !who->isInAccessiblePlaceFor(m_creature)) 
    77         return; 
    78  
    79     if(!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) 
    80         return; 
    81  
    82     if(!m_creature->IsWithinDistInMap(who, m_creature->GetAttackDistance(who)) || !m_creature->IsWithinLOSInMap(who)) 
    83         return; 
    84      
    85     if(m_creature->canAttack(who)) 
    86         //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); 
     76    if(!m_creature->getVictim() && m_creature->canStartAttack(who)) 
    8777        AttackStart(who); 
    8878}