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/game/Unit.cpp

    r266 r267  
    85438543    assert(target); 
    85448544 
     8545    if(!IsHostileTo(target)) 
     8546        return false; 
     8547 
    85458548    if(!target->isAttackableByAOE() || target->hasUnitState(UNIT_STAT_DIED)) 
    85468549        return false; 
     
    91279130    } 
    91289131 
     9132    // search nearby enemy before enter evade mode 
     9133    if(Unit *target = ((Creature*)this)->SelectNearestTarget()) 
     9134    { 
     9135        ((Creature*)this)->AI()->AttackStart(target); 
     9136        return true; 
     9137    } 
     9138 
    91299139    // enter in evade mode in other case 
    91309140    ((Creature*)this)->AI()->EnterEvadeMode();