DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ DropDuringRepacking()

void ActionRepackTentCB::DropDuringRepacking ( )
inlineprivate

См. определение в файле ActionRepackTent.c строка 8

9 {
10 vector orientation = m_ActionData.m_Player.GetOrientation();
11 vector position = m_ActionData.m_Player.GetPosition() + m_ActionData.m_Player.GetDirection();
12 vector rotation_matrix[3];
13 float direction[4];
14 InventoryLocation source = new InventoryLocation;
15 InventoryLocation destination = new InventoryLocation;
16
17 Math3D.YawPitchRollMatrix( orientation, rotation_matrix );
18 Math3D.MatrixToQuat( rotation_matrix, direction );
19
20 vector ground_position = position;
21 ground_position[1] = GetGame().SurfaceY(ground_position[0],ground_position[2]);
22
23 if ( vector.DistanceSq( m_ActionData.m_Player.GetPosition(), ground_position ) > UAMaxDistances.DEFAULT * UAMaxDistances.DEFAULT)
24 {
25 if ( m_ActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation( source ) )
26 {
27 destination.SetGroundEx( m_ActionData.m_MainItem, position, direction );
28 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
29 }
30 }
31 else
32 {
33 if ( m_ActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation( source ) )
34 {
35 destination.SetGroundEx( m_ActionData.m_MainItem, ground_position, direction );
36 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
37 }
38 }
39 }
ActionData m_ActionData
Определения AnimatedActionBase.c:3
proto native float SurfaceY(float x, float z)
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
proto native CGame GetGame()

Перекрестные ссылки UAMaxDistances::DEFAULT, vector::DistanceSq(), GetGame(), ActionBaseCB::m_ActionData, Math3D::MatrixToQuat(), InventoryLocation::SetGroundEx(), CGame::SurfaceY() и Math3D::YawPitchRollMatrix().

Используется в ActionRepackTent::OnStartAnimationLoopClient() и ActionRepackTent::OnStartAnimationLoopServer().