DayZ
1.24
Loading...
Searching...
No Matches
CCTSurface.c
Go to the documentation of this file.
1
class
CCTSurface
:
CCTBase
2
{
3
protected
float
m_MaximalActionDistanceSq
;
4
5
void
CCTSurface
(
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
|| (
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
}
24
};
CCTBase
Definition
CCTBase.c:2
CCTSurface
Definition
CCTSurface.c:2
CCTSurface::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTSurface.c:10
CCTSurface::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTSurface.c:3
CCTSurface::CCTSurface
void CCTSurface(float maximal_target_distance=UAMaxDistances.DEFAULT)
Definition
CCTSurface.c:5
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.
vector::Zero
static const vector Zero
Definition
EnConvert.c:110
GetGame
proto native CGame GetGame()
scripts
4_World
Classes
UserActionsComponent
TargetConditionsComponents
CCTSurface.c
Generated by
1.10.0