Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
cctman.c
Go to the documentation of this file.
1 class CCTMan : CCTBase
2 {
3  protected float m_MaximalActionDistanceSq;
4  protected bool m_MustBeAlive;
5 
6  void CCTMan ( float maximal_target_distance = UAMaxDistances.DEFAULT, bool must_be_alive = true )
7  {
8  m_MaximalActionDistanceSq = maximal_target_distance * maximal_target_distance;
9  m_MustBeAlive = must_be_alive;
10  }
11 
12  override bool Can( PlayerBase player, ActionTarget target )
13  {
14  if( !target )
15  return false;
16 
17  Object targetObject = target.GetObject();
18  if ( !player || !targetObject || targetObject == player || !targetObject.IsMan() || !player.IsFacingTarget(targetObject) || ( m_MustBeAlive && targetObject.IsDamageDestroyed() ) )
19  return false;
20 
21  return ( vector.DistanceSq(targetObject.GetPosition(), player.GetPosition()) <= m_MaximalActionDistanceSq );
22  }
23 };
CCTMan
Definition: cctman.c:1
CCTBase
Definition: cctbase.c:1
UAMaxDistances
Definition: actionconstants.c:104
PlayerBase
Definition: playerbaseclient.c:1
vector
Definition: enconvert.c:105
ActionTarget
class ActionTargets ActionTarget
Object
Definition: objecttyped.c:1