Fix issues with action Eject on non local vehicles (#8291)

This commit is contained in:
Joko 2021-07-24 00:25:00 +02:00 committed by GitHub
parent 0b7aa7f3e5
commit 08eadc7c19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,17 +47,22 @@ unassignVehicle _unit;
[_unit] orderGetIn false;
TRACE_1("Ejecting", alive _unit);
_unit action ["Eject", vehicle _unit];
private _vehicle = vehicle _unit;
if (local _vehicle) then {
_unit action ["Eject", _vehicle];
// Failsafe - sometimes eject alone doesn't work, but moveOut does
[{
params ["_unit"];
// Failsafe - sometimes eject alone doesn't work, but moveOut does
[{
params ["_unit"];
if (vehicle _unit != _unit) then {
WARNING_1("UnloadPersonLocal [%1] did not eject normally",_unit);
moveOut _unit;
};
}, [_unit], 1] call CBA_fnc_waitAndExecute;
if (vehicle _unit != _unit) then {
WARNING_1("UnloadPersonLocal [%1] did not eject normally",_unit);
moveOut _unit;
};
}, [_unit], 1] call CBA_fnc_waitAndExecute;
} else {
moveOut _unit;
};
[{
params ["_unit", "_emptyPos"];