Cargo - CanLoadItem ignores vehicle height on scripted load (#6629)

This commit is contained in:
PabstMirror 2018-10-08 15:23:59 -05:00 committed by GitHub
parent e54e8d0f8c
commit 9eba55be21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
* Arguments:
* 0: Item <OBJECT or STRING>
* 1: Holder Object (Vehicle) <OBJECT>
* 2: Ignore interaction distance <BOOL>
* 2: Ignore interaction distance and stability checks <BOOL>
*
* Return Value:
* Can load in <BOOL>
@ -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);

View File

@ -7,7 +7,7 @@
* Arguments:
* 0: Item <OBJECT or STRING>
* 1: Vehicle <OBJECT>
* 2: Ignore interaction distance <BOOL>
* 2: Ignore interaction distance and stability checks <BOOL>
*
* Return Value:
* Object loaded <BOOL>

View File

@ -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);
};