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

◆ Start()

override void ActionGetInTransport::Start ( ActionData action_data)
inlineprivate

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

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;
85 fwd.Normalize();
86
87 vector playerPosition = action_data.m_Player.GetPosition();
88 vector toTarget = transport.GetPosition() - playerPosition;
89 toTarget[1] = 0;
90 toTarget.Normalize();
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 {
107 vehCommand.SetVehicleType(transport.GetAnimInstance());
108
109 GetDayZGame().GetBacklit().OnEnterCar();
110 }
111 }
DayZGame GetDayZGame()
Определения DayZGame.c:4076
PlayerBase m_Player
Определения ActionBase.c:40
ref ActionTarget m_Target
Определения ActionBase.c:39
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.

Перекрестные ссылки vector::Dot(), GetDayZGame(), ActionData::m_Player, ActionData::m_Target, vector::Normalize(), HumanCommandVehicle::SetVehicleType() и Vector().