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

◆ ActionCondition()

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

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

27 {
28 HumanCommandVehicle vehCommand = player.GetCommand_Vehicle();
29
30 if ( vehCommand )
31 {
32 Transport trans = vehCommand.GetTransport();
33 if ( trans )
34 {
35 CarScript car;
36 if ( Class.CastTo(car, trans) )
37 {
38 if ( car.CrewMemberIndex( player ) == DayZPlayerConstants.VEHICLESEAT_DRIVER )
39 {
40 if ( !car.IsScriptedLightsOn() )
41 {
42 EntityAI neededItem = null;
43
44 if ( car.IsVitalCarBattery() ) neededItem = car.FindAttachmentBySlotName("CarBattery");
45 if ( car.IsVitalTruckBattery() ) neededItem = car.FindAttachmentBySlotName("TruckBattery");
46
47 if (neededItem && !neededItem.IsRuined())
48 {
49 return neededItem.GetCompEM() && neededItem.GetCompEM().GetEnergy() > 0;
50 }
51 }
52 else
53 {
54 return true;
55 }
56 }
57 }
58 }
59 }
60
61 return false;
62 }
class LogManager EntityAI
void CarScript()
Определения CarScript.c:280
override bool IsVitalTruckBattery()
Определения CivilianSedan.c:348
override bool IsVitalCarBattery()
Определения Truck_01_Base.c:335
proto native Transport GetTransport()
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602

Перекрестные ссылки ActionTarget, Class::CastTo(), HumanCommandVehicle::GetTransport(), CarScript::IsVitalCarBattery() и CarScript::IsVitalTruckBattery().