Unload _item when is vehicle in vehicle

This commit is contained in:
Vdauphin 2020-11-04 13:56:13 +01:00 committed by GitHub
parent 31426104e1
commit 10ca3d6678
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,10 +48,15 @@ private _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
if (_item isEqualType objNull) then {
detach _item;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
if (isVehicleCargo _item) then {
objNull setVehicleCargo _item;
_item setPosASL (AGLtoASL _emptyPosAGL);
} else {
detach _item;
// hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly
// do both on server to ensure they are executed in the correct order
[QGVAR(serverUnload), [_item, _emptyPosAGL]] call CBA_fnc_serverEvent;
};
} else {
private _newItem = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"];
_newItem setPosASL (AGLtoASL _emptyPosAGL);