9 {
10 vector orientation =
m_ActionData.m_Player.GetOrientation();
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 {
28 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
29 }
30 }
31 else
32 {
33 if (
m_ActionData.m_MainItem.GetInventory().GetCurrentInventoryLocation( source ) )
34 {
36 m_ActionData.m_Player.PredictiveTakeToDst(source, destination);
37 }
38 }
39 }
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()