Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CanOperateVehicleDoorCondition.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Requires the door to be open")]
5 protected bool m_bRequireOpenDoor;
6
7 [Attribute(SCR_ECompartmentDoorType.DOOR.ToString(), uiwidget: UIWidgets.ComboBox, desc: "Checks if door assigned to current compartment is a hatch", enumType: SCR_ECompartmentDoorType)]
9
10 //------------------------------------------------------------------------------------------------
12 {
13 ChimeraCharacter character = data.GetCharacter();
14 if (!character)
15 return GetReturnResult(false);
16
17 CompartmentAccessComponent compartmentAccessComp = character.GetCompartmentAccessComponent();
18 if (!compartmentAccessComp)
19 return GetReturnResult(false);
20
21 if (compartmentAccessComp.IsGettingIn() || compartmentAccessComp.IsGettingOut() || compartmentAccessComp.IsSwitchingSeatsAnim())
22 return GetReturnResult(false);
23
24 BaseCompartmentSlot compartment = compartmentAccessComp.GetCompartment();
25 if (!compartment)
26 return GetReturnResult(false);
27
28 array<int> arr = {};
29 compartment.GetAvailableDoorIndices(arr);
30 if (arr.IsEmpty())
31 return GetReturnResult(false);
32
33 int mainDoorId = arr[0];
34 if (mainDoorId == compartment.GetTurnOutDoorIndex())
35 return GetReturnResult(false);
36
37 BaseCompartmentManagerComponent compartmentManager = compartment.GetManager();
38 if (!compartmentManager)
39 return GetReturnResult(false);
40
41 if (compartmentManager.IsDoorFake(mainDoorId))
42 return GetReturnResult(false);
43
44 SCR_CompartmentDoorInfo doorInfo = SCR_CompartmentDoorInfo.Cast(compartmentManager.GetDoorInfo(mainDoorId));
45 SCR_ECompartmentDoorType doorType = SCR_ECompartmentDoorType.DOOR;//we assume that if there is no info about the door type then it must be a door
46 if (doorInfo)
47 doorType = doorInfo.GetDoorType();
48
49 if (doorType != m_eDoorType)
50 return GetReturnResult(false);
51
52 if (!m_bRequireOpenDoor && !compartmentAccessComp.CanAccessDoor(compartment.GetOwner(), compartmentManager, mainDoorId))
53 return GetReturnResult(false);
54
55 return GetReturnResult(compartmentManager.IsDoorOpen(mainDoorId) == m_bRequireOpenDoor);
56 }
57}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_ECompartmentDoorType
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
A single available action condition representation.
override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
SCR_ECompartmentDoorType GetDoorType()
SCR_FieldOfViewSettings Attribute