From 0025268eb00412067ddf5eb3e6f4a08ec45913c1 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Wed, 4 Aug 2021 18:56:48 +0200 Subject: [PATCH] fix twice parachute - acify --- addons/cargo/functions/fnc_canShowUnloadAllVehicles.sqf | 2 +- addons/cargo/functions/fnc_paradropItem.sqf | 2 +- addons/cargo/functions/fnc_unload.sqf | 9 +++++++-- addons/cargo/functions/fnc_unloadAllVehicles.sqf | 2 +- addons/cargo/functions/fnc_unloadItem.sqf | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/addons/cargo/functions/fnc_canShowUnloadAllVehicles.sqf b/addons/cargo/functions/fnc_canShowUnloadAllVehicles.sqf index 4e4b6fdf74..552a00b700 100644 --- a/addons/cargo/functions/fnc_canShowUnloadAllVehicles.sqf +++ b/addons/cargo/functions/fnc_canShowUnloadAllVehicles.sqf @@ -23,4 +23,4 @@ params [ driver _vehicle isEqualTo _unit && {isClass (configOf _vehicle >> "VehicleTransport" >> "Carrier")} && -{!([_vehicle] call ace_cargo_fnc_getVehicleCargo isEqualTo [])} +{!([_vehicle] call FUNC(getVehicleCargo) isEqualTo [])} diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index 13bf53b951..9089ae3993 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -29,7 +29,7 @@ private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters beh TRACE_1("",_distBehind); private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2]; -private _object = [_item, _posBehindVehicleAGL, _loaded, _vehicle] call ace_cargo_fnc_unload; +private _object = [_item, _posBehindVehicleAGL, _loaded, _vehicle, true] call FUNC(unload); _object setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)); diff --git a/addons/cargo/functions/fnc_unload.sqf b/addons/cargo/functions/fnc_unload.sqf index a2f0c1c875..6c83f39515 100644 --- a/addons/cargo/functions/fnc_unload.sqf +++ b/addons/cargo/functions/fnc_unload.sqf @@ -8,6 +8,7 @@ * 1: Empty position * 2: Items loaded in cargo * 3: Vehicle with the item loaded + * 4: Avoid creation of a parachute by A3 * * Return Value: * Object unloaded @@ -18,7 +19,7 @@ * Public: No */ -params ["_item", "_posAGL", "_loaded", "_vehicle"]; +params ["_item", "_posAGL", "_loaded", "_vehicle", "_isParadrop"]; _loaded deleteAt (_loaded find _item); _vehicle setVariable [QGVAR(loaded), _loaded, true]; @@ -46,7 +47,11 @@ if (_object isEqualType objNull) then { }; }; } else { - objNull setVehicleCargo _object; + if (_isParadrop) then { + detach _object; // Don't create a parachute by A3 engine + } else { + objNull setVehicleCargo _object; + }; _object setPosASL (AGLtoASL _posAGL); }; } else { diff --git a/addons/cargo/functions/fnc_unloadAllVehicles.sqf b/addons/cargo/functions/fnc_unloadAllVehicles.sqf index deaaf5dfeb..75560dbea2 100644 --- a/addons/cargo/functions/fnc_unloadAllVehicles.sqf +++ b/addons/cargo/functions/fnc_unloadAllVehicles.sqf @@ -17,7 +17,7 @@ params ["_vehicle"]; -private _loadedVehicles = [_vehicle] call ace_cargo_fnc_getVehicleCargo; +private _loadedVehicles = [_vehicle] call FUNC(getVehicleCargo); private _unloadingInterval = getNumber (configOf _vehicle >> "VehicleTransport" >> "Carrier" >> "unloadingInterval"); { [{objnull setVehicleCargo _this}, _x, _forEachIndex * _unloadingInterval] call CBA_fnc_waitAndExecute; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 22c2acaf9c..c5bb08bf18 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -40,7 +40,7 @@ if !(_item in _loaded) exitWith { false }; -private _object = [_item, _emptyPosAGL, _loaded, _vehicle] call ace_cargo_fnc_unload; +private _object = [_item, _emptyPosAGL, _loaded, _vehicle, false] call FUNC(unload); // Invoke listenable event ["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent;