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,8 +47,9 @@ 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"];
@ -59,6 +60,10 @@ _unit action ["Eject", vehicle _unit];
};
}, [_unit], 1] call CBA_fnc_waitAndExecute;
} else {
moveOut _unit;
};
[{
params ["_unit", "_emptyPos"];
(alive _unit) && {(vehicle _unit) != _unit}