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

◆ ActionCondition()

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

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

20 {
21
22 Transport trans = null;
23 int nextSeatIdx = -1;
24
25 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
26
27 if ( !vehCommand )
28 return false;
29
30 int componentIndex = target.GetComponentIndex();
31
32 if ( !target )
33 return false;
34
35 if ( !Class.CastTo(trans, target.GetObject()) )
36 return false;
37
38 nextSeatIdx = trans.CrewPositionIndex( componentIndex );
39
40 if ( nextSeatIdx < 0 )
41 return false;
42
43 Human crew = trans.CrewMember( nextSeatIdx );
44 if ( crew )
45 return false;
46
47 if ( !trans.CanReachSeatFromSeat( trans.CrewMemberIndex( player ), nextSeatIdx ) )
48 return false;
49
50 return true;
51 }

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