27 {
28
29 if (!target)
30 return false;
31
32 Transport transport = null;
33 if (!Class.CastTo(transport, target.GetObject()))
34 return false;
35
36 if (!transport.CanGetIn())
37 return false;
38
39 if (player.GetItemInHands() && player.GetItemInHands().IsHeavyBehaviour())
40 return false;
41
42 if (player.GetCommand_Vehicle())
43 return false;
44
45 int componentIndex = target.GetComponentIndex();
46 int crewIndex = transport.CrewPositionIndex(componentIndex);
47 if (crewIndex < 0)
48 return false;
49
50 Human crew = transport.CrewMember(crewIndex);
51 if (crew)
52 return false;
53
54 if (!transport.CrewCanGetThrough(crewIndex) || !transport.IsAreaAtDoorFreeDiag(crewIndex))
55 return false;
56
57 array<string> selections = new array<string>();
58 transport.GetActionComponentNameList(componentIndex, selections);
59 int selectionCount = selections.Count();
60 vector playerPosition = player.GetPosition();
61
62 for (int i = 0; i < selectionCount; ++i)
63 {
64 if (transport.CanReachSeatFromDoors(selections[i], playerPosition, 1.0))
65 return true;
66 }
67
68 return false;
69 }