491 {
494 return -1;
495
496 if (pTarget)
497 {
498 if (pTarget == cursorTarget)
499 {
501 if (pTarget.GetType() == string.Empty)
502 return 0.01;
503
504 if (pTarget.IsBuilding())
505 return 0.25;
506
507 if (pTarget.IsTransport())
508 return 0.25;
509
511 if (pTarget.CanUseConstruction())
512 return 0.85;
513
514 if (pTarget.IsWell())
515 return 0.9;
516
517 vector playerPosXZ =
m_Player.GetPosition();
518 vector hitPosXZ = hitPos;
519 playerPosXZ[1] = 0;
520 hitPosXZ[1] = 0;
523 }
524
525 if ( PlayerBase.Cast(pTarget) && PlayerBase.Cast(pTarget).IsInVehicle() )
526 return 0.20;
527
530 }
531
534 return 0.01;
535
536 return -1;
537 }
SurfaceInfo m_SurfaceInfo
first valid hitpos! Used only as rough reference value for conecasted results.
const float c_UtilityMaxDistFromRaySqr
const float c_MaxTargetDistance
const float c_UtilityValueCoef
float DistSqrPoint2Line(vector pPoint, vector pL1, vector pL2)
distance between point and line
PlayerBase m_Player
player owner
const float c_UtilityMaxValue
utility constants