DayZ 1.24
Loading...
Searching...
No Matches
CCTSurface Class Reference
Inheritance diagram for CCTSurface:
[legend]
Collaboration diagram for CCTSurface:
[legend]

Protected Member Functions

void CCTSurface (float maximal_target_distance=UAMaxDistances.DEFAULT)
 
override bool Can (PlayerBase player, ActionTarget target)
 

Protected Attributes

float m_MaximalActionDistanceSq
 

Detailed Description

Definition at line 1 of file CCTSurface.c.

Constructor & Destructor Documentation

◆ CCTSurface()

void CCTSurface::CCTSurface ( float maximal_target_distance = UAMaxDistances.DEFAULT)
inlineprotected

Member Function Documentation

◆ Can()

override bool CCTSurface::Can ( PlayerBase player,
ActionTarget target )
inlineprotected

Definition at line 10 of file CCTSurface.c.

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 }
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static const vector Zero
Definition EnConvert.c:110
proto native CGame GetGame()

References vector::DistanceSq(), GetGame(), m_MaximalActionDistanceSq, and vector::Zero.

Member Data Documentation

◆ m_MaximalActionDistanceSq

float CCTSurface::m_MaximalActionDistanceSq
protected

Definition at line 3 of file CCTSurface.c.

Referenced by Can(), and CCTSurface().


The documentation for this class was generated from the following file: