diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index 87806892413..7d5d98dc0cd 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Item * 1: Holder Object (Vehicle) + * 2: Ignore interaction distance * * Return Value: * Can load in @@ -16,7 +17,7 @@ */ #include "script_component.hpp" -params [["_item", "", [objNull,""]], "_vehicle"]; +params [["_item", "", [objNull,""]], "_vehicle", ["_ignoreInteraction", false]]; if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}) exitWith {TRACE_1("vehicle not stable",_vehicle); false}; @@ -34,7 +35,7 @@ if (_item isEqualType "") then { } else { _validItem = (alive _item) && - {([_item, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}; + {_ignoreInteraction || {([_item, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}}; }; _validItem && diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index f8b00478e6e..cb4772b7916 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -6,6 +6,7 @@ * Arguments: * 0: Item * 1: Vehicle + * 2: Ignore interaction distance * * Return Value: * Object loaded @@ -17,10 +18,10 @@ */ #include "script_component.hpp" -params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]]; +params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]], ["_ignoreInteraction", false]]; TRACE_2("params",_item,_vehicle); -if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {TRACE_2("cannot load",_item,_vehicle); false}; +if !([_item, _vehicle, _ignoreInteraction] call FUNC(canLoadItemIn)) exitWith {TRACE_2("cannot load",_item,_vehicle); false}; private _loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded pushBack _item;