Changeset 141 for trunk/src/game/TargetedMovementGenerator.cpp
- Timestamp:
- 11/19/08 13:39:50 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/TargetedMovementGenerator.cpp
r118 r141 61 61 { 62 62 // to nearest random contact position 63 i_target->GetRandomContactPoint( &owner, x, y, z, 0.5f,4.5f );63 i_target->GetRandomContactPoint( &owner, x, y, z, 0.5f, ATTACK_DISTANCE - 0.5f ); 64 64 } 65 65 else … … 165 165 i_destinationHolder.ResetUpdate(50); 166 166 167 float dist = i_target->GetObjectSize() + owner.GetObjectSize() + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE);167 float dist = owner.GetFloatValue(UNIT_FIELD_COMBATREACH) + i_target.getTarget()->GetFloatValue(UNIT_FIELD_COMBATREACH) + sWorld.getRate(RATE_TARGET_POS_RECALCULATION_RANGE); 168 168 169 169 //More distance let have better performance, less distance let have more sensitive reaction at target move. … … 186 186 187 187 owner.StopMoving(); 188 if(owner. canReachWithAttack(i_target.getTarget()) && !owner.hasUnitState(UNIT_STAT_FOLLOW))188 if(owner.IsWithinCombatDist(i_target.getTarget(), ATTACK_DISTANCE) && !owner.hasUnitState(UNIT_STAT_FOLLOW)) 189 189 owner.Attack(i_target.getTarget(),true); 190 190 }