Put _item in vehicle in vehicle if possible

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

View File

@ -35,11 +35,13 @@ _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (_item isEqualType objNull) then {
detach _item;
_item attachTo [_vehicle,[0,0,-100]];
[QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent;
if !(_vehicle setVehicleCargo _item) then {
_item attachTo [_vehicle,[0,0,-100]];
[QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent;
// Some objects below water will take damage over time and eventualy become "water logged" and unfixable (because of negative z attach)
[_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set);
// Some objects below water will take damage over time and eventualy become "water logged" and unfixable (because of negative z attach)
[_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set);
};
};
true