6 {
7 if ( !DeveloperFreeCamera.IsFreeCameraEnabled() )
8 {
10 vector pos_player = player.GetPosition();
11
13 if (!Class.CastTo(ignore, player.GetParent()))
14 {
15 ignore = player;
16 }
17
20 vector hitPos;
21 vector hitNormal;
22 int hitComponentIndex;
23 DayZPhysics.RaycastRV(rayStart, rayEnd, hitPos, hitNormal, hitComponentIndex, NULL, NULL, ignore);
24
25 float distance = vector.
Distance( pos_player, hitPos );
26
28 {
29 bool breakSync = false;
30
31 #ifdef DIAG_DEVELOPER
32 breakSync = DiagMenu.GetBool(
DiagMenuIDs.MISC_TELEPORT_BREAKS_SYNC);
33 #endif
34
36 }
37 else
38 {
39 Debug.LogWarning(
"Distance for teleportation is too far!");
40 }
41 }
42 }
proto native vector GetCurrentCameraPosition()
proto native vector GetCurrentCameraDirection()
static const float TELEPORT_DISTANCE_MAX
static void SetPlayerPosition(PlayerBase player, vector position, bool breakSync=false)
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()