4 override bool CanBePerformedScript(IEntity user)
6 ChimeraCharacter character = ChimeraCharacter.Cast(user);
7 if (!character && !character.IsInVehicle())
10 CharacterControllerComponent characterController = character.GetCharacterController();
11 if (!characterController)
14 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
15 if (!compartmentAccess)
18 BaseCompartmentSlot characterCompartment = compartmentAccess.GetCompartment();
19 if (!characterCompartment)
22 BaseCompartmentSlot compartment = GetCompartmentSlot();
26 if (characterCompartment == compartment)
30 if (characterCompartment.GetCompartmentSection() != compartment.GetCompartmentSection())
33 auto commandHandler = character.GetAnimationComponent().GetCommandHandler();
34 if (commandHandler && commandHandler.IsVehicleSwitchingSeats())
38 if (characterCompartment.GetOwner().GetRootParent() !=
GetOwner().GetRootParent())
42 if (m_pLockComp && m_pLockComp.IsLocked(user, compartment))
44 SetCannotPerformReason(m_pLockComp.GetCannotPerformReason(user));
52 override bool CanBeShownScript(IEntity user)
57 BaseCompartmentSlot compartment = GetCompartmentSlot();
61 if (compartment.GetOccupant())
64 ChimeraCharacter character = ChimeraCharacter.Cast(user);
65 if (!character && !character.IsInVehicle())
68 CompartmentAccessComponent compartmentAccess = character.GetCompartmentAccessComponent();
69 if (!compartmentAccess)
72 if (compartmentAccess.IsGettingIn() || compartmentAccess.IsGettingOut())
75 BaseCompartmentSlot characterCompartment = compartmentAccess.GetCompartment();
76 if (!characterCompartment)
79 if (characterCompartment == compartment)
83 if (characterCompartment.GetCompartmentSection() != compartment.GetCompartmentSection())
86 auto commandHandler = character.GetAnimationComponent().GetCommandHandler();
87 if (commandHandler && commandHandler.IsVehicleSwitchingSeats())
91 if (characterCompartment.GetOwner().GetRootParent() !=
GetOwner().GetRootParent())
97 auto vehicleController = VehicleControllerComponent.Cast(characterCompartment.GetController());
98 if (vehicleController && !vehicleController.CanSwitchSeat())
103 auto vehicleController = VehicleControllerComponent_SA.Cast(characterCompartment.GetController());
104 if (vehicleController && !vehicleController.CanSwitchSeat())