DayZ
1.24
Loading...
Searching...
No Matches
CCTNonRuined.c
Go to the documentation of this file.
1
class
CCTNonRuined
:
CCTBase
2
{
3
protected
float
m_MaximalActionDistanceSq
;
4
5
void
CCTNonRuined
(
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
)
13
return
false
;
14
15
Object
targetObject
=
target
.GetObject();
16
if
(!
player
|| !
targetObject
||
targetObject
.IsMan() ||
targetObject
.IsDamageDestroyed())
17
return
false
;
18
19
return
(
vector
.
DistanceSq
(
targetObject
.GetPosition(),
player
.GetPosition()) <=
m_MaximalActionDistanceSq
);
20
}
21
};
CCTBase
Definition
CCTBase.c:2
CCTNonRuined
Definition
CCTNonRuined.c:2
CCTNonRuined::CCTNonRuined
void CCTNonRuined(float maximal_target_distance=UAMaxDistances.DEFAULT)
Definition
CCTNonRuined.c:5
CCTNonRuined::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTNonRuined.c:3
CCTNonRuined::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTNonRuined.c:10
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UAMaxDistances
Definition
ActionConstants.c:105
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:107
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.
scripts
4_World
Classes
UserActionsComponent
TargetConditionsComponents
CCTNonRuined.c
Generated by
1.10.0