72 {
73 super.Start(action_data);
74
75 Transport transport = Transport.Cast(action_data.
m_Target.GetObject());
76 int componentIndex = action_data.
m_Target.GetComponentIndex();
77 int crewIndex = transport.CrewPositionIndex(componentIndex);
78
79 float direction = 0;
80 int seat;
81 if (transport.HasDirectionalInOutAction())
82 {
83 vector fwd = transport.GetDirection();
84 fwd[1] = 0;
86
87 vector playerPosition = action_data.
m_Player.GetPosition();
88 vector toTarget = transport.GetPosition() - playerPosition;
89 toTarget[1] = 0;
91
92 vector right =
Vector(fwd[2], 0.0, -fwd[0]);
93
94 float side = vector.Dot(toTarget, right);
95
96 if (side < 0.0)
97 direction = 1;
98
99 seat = transport.GetSeatAnimationTypeDirectional(crewIndex, direction);
100 }
101 else
102 seat = transport.GetSeatAnimationType(crewIndex);
103
104 HumanCommandVehicle vehCommand = action_data.
m_Player.StartCommand_Vehicle(transport, crewIndex, seat);
105 if (vehCommand)
106 {
108
110 }
111 }
ref ActionTarget m_Target
proto native void SetVehicleType(int pVehicleType)
proto float Normalize()
Normalizes vector. Returns length.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.