DayZ 1.24
Loading...
Searching...
No Matches
CCTMan.c
Go to the documentation of this file.
2{
3 protected float m_MaximalActionDistanceSq;
4 protected bool m_MustBeAlive;
5
11
12 override bool Can(PlayerBase player, ActionTarget target)
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 }
23};
Definition CCTMan.c:2
bool m_MustBeAlive
Definition CCTMan.c:4
float m_MaximalActionDistanceSq
Definition CCTMan.c:3
void CCTMan(float maximal_target_distance=UAMaxDistances.DEFAULT, bool must_be_alive=true)
Definition CCTMan.c:6
override bool Can(PlayerBase player, ActionTarget target)
Definition CCTMan.c:12
const float DEFAULT
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.