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

Protected Member Functions

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

Protected Attributes

float m_MaximalActionDistanceSq
 
bool m_MustBeAlive
 

Detailed Description

Definition at line 1 of file CCTMan.c.

Constructor & Destructor Documentation

◆ CCTMan()

void CCTMan::CCTMan ( float maximal_target_distance = UAMaxDistances.DEFAULT,
bool must_be_alive = true )
inlineprotected

Definition at line 6 of file CCTMan.c.

References m_MaximalActionDistanceSq, and m_MustBeAlive.

Member Function Documentation

◆ Can()

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

Definition at line 12 of file CCTMan.c.

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

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

Member Data Documentation

◆ m_MaximalActionDistanceSq

float CCTMan::m_MaximalActionDistanceSq
protected

Definition at line 3 of file CCTMan.c.

Referenced by Can(), and CCTMan().

◆ m_MustBeAlive

bool CCTMan::m_MustBeAlive
protected

Definition at line 4 of file CCTMan.c.

Referenced by Can(), and CCTMan().


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