From 9eba55be219f1b06d05f9050ca493062a460366d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 8 Oct 2018 15:23:59 -0500 Subject: [PATCH] Cargo - CanLoadItem ignores vehicle height on scripted load (#6629) --- addons/cargo/functions/fnc_canLoadItemIn.sqf | 4 ++-- addons/cargo/functions/fnc_loadItem.sqf | 2 +- addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index 0d4508377c..f7bc696d35 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -6,7 +6,7 @@ * Arguments: * 0: Item * 1: Holder Object (Vehicle) - * 2: Ignore interaction distance + * 2: Ignore interaction distance and stability checks * * Return Value: * Can load in @@ -19,7 +19,7 @@ params [["_item", "", [objNull,""]], "_vehicle", ["_ignoreInteraction", false]]; -if (speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}) exitWith {TRACE_1("vehicle not stable",_vehicle); false}; +if ((!_ignoreInteraction) && {speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}}) exitWith {TRACE_1("vehicle not stable",_vehicle); false}; if (_item isEqualType objNull && {{alive _x && {getText (configFile >> "CfgVehicles" >> typeOf _x >> "simulation") != "UAVPilot"}} count crew _item > 0}) exitWith { TRACE_1("item is occupied",_item); diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index a04182064e..73056ef43f 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -7,7 +7,7 @@ * Arguments: * 0: Item * 1: Vehicle - * 2: Ignore interaction distance + * 2: Ignore interaction distance and stability checks * * Return Value: * Object loaded diff --git a/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf index a5462443bb..b13c0cc29b 100644 --- a/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf +++ b/addons/zeus/functions/fnc_moduleLoadIntoCargo.sqf @@ -43,7 +43,7 @@ if (!alive _cargo) exitWith { params ["_successful", "_cargo", "_mousePosASL"]; if (!_successful) exitWith {}; - private _holder = (nearestObjects [ASLToAGL _mousePosASL, EGVAR(cargo,cargoHolderTypes), 5]) param [0, objNull]; + private _holder = (nearestObjects [ASLToAGL _mousePosASL, EGVAR(cargo,cargoHolderTypes), 5, true]) param [0, objNull]; // 2d distance search if (isNull _holder) exitWith { [LSTRING(NothingSelected)] call FUNC(showMessage); };