DayZ
1.24
Loading...
Searching...
No Matches
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
};
CCTBase
Definition
CCTBase.c:2
CCTTree
Definition
CCTTree.c:2
CCTTree::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTTree.c:10
CCTTree::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTTree.c:3
CCTTree::CCTTree
void CCTTree(float maximal_target_distance)
Definition
CCTTree.c:5
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
vector
Definition
EnConvert.c:106
vector::DistanceSq
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
GetGame
proto native CGame GetGame()
scripts
4_World
Classes
UserActionsComponent
TargetConditionsComponents
CCTTree.c
Generated by
1.10.0