fix twice parachute

- acify
This commit is contained in:
Vdauphin 2021-08-04 18:56:48 +02:00
parent 74c4b274ff
commit 0025268eb0
5 changed files with 11 additions and 6 deletions

View File

@ -23,4 +23,4 @@ params [
driver _vehicle isEqualTo _unit && driver _vehicle isEqualTo _unit &&
{isClass (configOf _vehicle >> "VehicleTransport" >> "Carrier")} && {isClass (configOf _vehicle >> "VehicleTransport" >> "Carrier")} &&
{!([_vehicle] call ace_cargo_fnc_getVehicleCargo isEqualTo [])} {!([_vehicle] call FUNC(getVehicleCargo) isEqualTo [])}

View File

@ -29,7 +29,7 @@ private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters beh
TRACE_1("",_distBehind); TRACE_1("",_distBehind);
private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2]; 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)); _object setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5));

View File

@ -8,6 +8,7 @@
* 1: Empty position <ARRAY> * 1: Empty position <ARRAY>
* 2: Items loaded in cargo <ARRAY> * 2: Items loaded in cargo <ARRAY>
* 3: Vehicle with the item loaded <OBJECT> * 3: Vehicle with the item loaded <OBJECT>
* 4: Avoid creation of a parachute by A3 <BOOL>
* *
* Return Value: * Return Value:
* Object unloaded <OBJECT> * Object unloaded <OBJECT>
@ -18,7 +19,7 @@
* Public: No * Public: No
*/ */
params ["_item", "_posAGL", "_loaded", "_vehicle"]; params ["_item", "_posAGL", "_loaded", "_vehicle", "_isParadrop"];
_loaded deleteAt (_loaded find _item); _loaded deleteAt (_loaded find _item);
_vehicle setVariable [QGVAR(loaded), _loaded, true]; _vehicle setVariable [QGVAR(loaded), _loaded, true];
@ -46,7 +47,11 @@ if (_object isEqualType objNull) then {
}; };
}; };
} else { } 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); _object setPosASL (AGLtoASL _posAGL);
}; };
} else { } else {

View File

@ -17,7 +17,7 @@
params ["_vehicle"]; params ["_vehicle"];
private _loadedVehicles = [_vehicle] call ace_cargo_fnc_getVehicleCargo; private _loadedVehicles = [_vehicle] call FUNC(getVehicleCargo);
private _unloadingInterval = getNumber (configOf _vehicle >> "VehicleTransport" >> "Carrier" >> "unloadingInterval"); private _unloadingInterval = getNumber (configOf _vehicle >> "VehicleTransport" >> "Carrier" >> "unloadingInterval");
{ {
[{objnull setVehicleCargo _this}, _x, _forEachIndex * _unloadingInterval] call CBA_fnc_waitAndExecute; [{objnull setVehicleCargo _this}, _x, _forEachIndex * _unloadingInterval] call CBA_fnc_waitAndExecute;

View File

@ -40,7 +40,7 @@ if !(_item in _loaded) exitWith {
false 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 // Invoke listenable event
["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent; ["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent;