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

◆ ActionCondition()

override bool ActionGetInTransport::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

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

27 {
28 Transport trans = null;
29
30 if (!target)
31 {
32 return false;
33 }
34
35 if (!Class.CastTo(trans, target.GetObject()))
36 {
37 return false;
38 }
39
40 if (player.GetItemInHands() && player.GetItemInHands().IsHeavyBehaviour())
41 {
42 return false;
43 }
44
45 if (player.GetCommand_Vehicle())
46 {
47 return false;
48 }
49
50 int componentIndex = target.GetComponentIndex();
51 int crew_index = trans.CrewPositionIndex(componentIndex);
52 if (crew_index < 0)
53 {
54 return false;
55 }
56
57 Human crew = trans.CrewMember(crew_index);
58 if (crew)
59 {
60 return false;
61 }
62
63 if (!trans.CrewCanGetThrough(crew_index) || !trans.IsAreaAtDoorFree(crew_index))
64 {
65 return false;
66 }
67
68 array<string> selections = new array<string>();
69 trans.GetActionComponentNameList(componentIndex, selections);
70
71 for (int i = 0; i < selections.Count(); i++)
72 {
73 if (trans.CanReachSeatFromDoors(selections[i], player.GetPosition(), 1.0))
74 {
75 return true;
76 }
77 }
78
79 return false;
80 }
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight=0.5, float horizontalExtents=0.5, float playerHeight=1.7)
Определения Car.c:102

Перекрестные ссылки ActionTarget, Class::CastTo() и Transport::IsAreaAtDoorFree().