Cargo - Fix/Improve FUNC(paradropItem) (#9399)

paradropItem fixes
This commit is contained in:
johnb432 2023-09-14 23:54:06 +02:00 committed by GitHub
parent f7b520b56b
commit a0dd4400e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -2,9 +2,9 @@
["ace_addCargo", {_this call FUNC(addCargoItem)}] call CBA_fnc_addEventHandler;
[QGVAR(paradropItem), {
params ["_item", "_vehicle"];
params ["_item", "_vehicle", ["_showHint", true]];
private _unloaded = [_item, _vehicle] call FUNC(paradropItem);
private _unloaded = [_item, _vehicle, _showHint] call FUNC(paradropItem);
if (_unloaded && {GVAR(openAfterUnload) in [2, 3]}) then {
GVAR(interactionVehicle) = _vehicle;

View File

@ -49,7 +49,7 @@ if (_item isEqualType objNull) then {
_object setPosASL (AGLtoASL _posBehindVehicleAGL);
};
_object setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5));
[QEGVAR(common,setVelocity), [_object, ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5))], _object] call CBA_fnc_targetEvent;
// open parachute and ir light effect
[{
@ -59,13 +59,20 @@ _object setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir
private _parachute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "CAN_COLLIDE"];
// Prevent collision damage
[QEGVAR(common,fixCollision), _parachute] call CBA_fnc_localEvent;
[QEGVAR(common,fixCollision), _object, _object] call CBA_fnc_targetEvent;
// cannot use setPos on parachutes without them closing down
_parachute attachTo [_object, [0,0,0]];
detach _parachute;
private _velocity = velocity _object;
_object attachTo [_parachute, [0,0,1]];
// Attach to the middle of the object
(2 boundingBoxReal _object) params ["_bb1", "_bb2"];
_object attachTo [_parachute, [0, 0, ((_bb2 select 2) - (_bb1 select 2)) / 2]];
_parachute setVelocity _velocity;
if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then {