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