From 31426104e1b311103dbee7bfd20aaf51c6c53867 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Wed, 4 Nov 2020 13:43:35 +0100 Subject: [PATCH] Put _item in vehicle in vehicle if possible --- addons/cargo/functions/fnc_loadItem.sqf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index f69996c1d4..554c99fee9 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -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