DayZ
1.24
Loading...
Searching...
No Matches
CCTCursorNoObject.c
Go to the documentation of this file.
1
class
CCTCursorNoObject
:
CCTBase
2
{
3
protected
float
m_MaximalActionDistanceSq
;
4
5
void
CCTCursorNoObject
(
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
if
(
GetGame
().IsServer() &&
GetGame
().IsMultiplayer())
16
return
true
;
17
18
vector
playerHeadPos
;
19
MiscGameplayFunctions
.GetHeadBonePos(
player
,
playerHeadPos
);
20
21
float
distanceRoot
=
vector
.
DistanceSq
(
target
.GetCursorHitPos(),
player
.GetPosition());
22
float
distanceHead
=
vector
.
DistanceSq
(
target
.GetCursorHitPos(),
playerHeadPos
);
23
24
return
(
distanceRoot
<=
m_MaximalActionDistanceSq
||
distanceHead
<=
m_MaximalActionDistanceSq
);
25
}
26
};
CCTBase
Definition
CCTBase.c:2
CCTCursorNoObject
Definition
CCTCursorNoObject.c:2
CCTCursorNoObject::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTCursorNoObject.c:3
CCTCursorNoObject::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTCursorNoObject.c:10
CCTCursorNoObject::CCTCursorNoObject
void CCTCursorNoObject(float maximal_target_distance)
Definition
CCTCursorNoObject.c:5
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
CCTCursorNoObject.c
Generated by
1.10.0