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