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

Protected Member Functions

void CCTTree (float maximal_target_distance)
 
override bool Can (PlayerBase player, ActionTarget target)
 

Protected Attributes

float m_MaximalActionDistanceSq
 

Detailed Description

Definition at line 1 of file CCTTree.c.

Constructor & Destructor Documentation

◆ CCTTree()

void CCTTree::CCTTree ( float maximal_target_distance)
inlineprotected

Definition at line 5 of file CCTTree.c.

References m_MaximalActionDistanceSq.

Member Function Documentation

◆ Can()

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

Definition at line 10 of file CCTTree.c.

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

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

Member Data Documentation

◆ m_MaximalActionDistanceSq

float CCTTree::m_MaximalActionDistanceSq
protected

Definition at line 3 of file CCTTree.c.

Referenced by Can(), and CCTTree().


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