19 if ( !target )
return false;
21 Object target_object = target.GetObject();
22 string action_selection = target_object.GetActionComponentName( target.GetComponentIndex() );
29 vector fire_point_pos_world, fire_point_rot_world;
36 vector diff = fire_point_rot_world - fire_point_pos_world;
39 float dotp =
vector.
Dot(
"0 0 1" , diff );
41 if ( ( diff[0] < 0 ) && ( diff[2] < 0 ) )
42 rot_deg = 360.0 - rot_deg;
43 else if ( ( diff[0] < 0 ) && ( diff[2] > 0 ) )
44 rot_deg = 360.0 - rot_deg;
49 float fire_point_dist =
vector.
Distance( fire_point_pos_world, player.GetPosition() );
50 if ( fire_point_dist <= 2 )
52 player.SetLastFirePoint( fire_point_pos_world );
53 player.SetLastFirePointIndex( fire_point_index );
54 player.SetLastFirePointRot( rot_deg );
66 int index = action_data.m_Player.GetLastFirePointIndex();
73 vector smoke_point_pos_world = action_data.m_Target.GetObject().ModelToWorld(smoke_point_pos);
84 fp_indoor.SetOrientation(fprot);
86 fp_indoor.Synchronize();
92 action_data.m_Player.LocalTakeEntityToTargetAttachment(fp_indoor, action_data.m_MainItem);
95 action_data.m_Player.ServerTakeEntityToTargetAttachment(fp_indoor, action_data.m_MainItem);
ActionPlaceFireplaceIndoor m_FirePointIndex
class ActionTargets ActionTarget
const int ECE_PLACE_ON_SURFACE
bool IsInReach(PlayerBase player, ActionTarget target, float maxDistance=1.0)
ref CCIBase m_ConditionItem
void ClearInventoryReservationEx(ActionData action_data)
ref CCTBase m_ConditionTarget
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override void CreateConditionComponents()
override void OnExecuteServer(ActionData action_data)
override void OnExecuteClient(ActionData action_data)
void ActionCreateIndoorFireplace()
override bool IsLockTargetOnUse()
void ActionSingleUseBase()
string GetFireplaceType(int firePointIndex)
proto native Object CreateObjectEx(string type, vector pos, int iFlags, int iRotation=RF_DEFAULT)
Creates object of certain type.
static bool CanPlaceFireplaceInSelectedSpot(Object building, int fire_point_index, out vector fire_point_pos_world, out vector fire_point_rot_world)
void SetSmokePointPosition(vector smoke_point_pos)
static const string FIREPOINT_PLACE_ROT
static int GetFirePointIndex(string action_selection)
static const string FIREPOINT_ACTION_SELECTION
void SetFirePointIndex(int fire_point_index)
static const string FIREPOINT_SMOKE_POSITION
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
static proto float Acos(float c)
Returns angle in radians from cosinus.
static const float RAD2DEG
bool Contains(string sample)
Returns true if sample is substring of string.