Skip to content

Commit

Permalink
Cargo - Reenable UAV AI when on ground when paradropped (acemod#10137)
Browse files Browse the repository at this point in the history
Reenable UAV AI when on ground when paradropped
  • Loading branch information
johnb432 authored and blake8090 committed Aug 18, 2024
1 parent 85503c3 commit 04138d3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions addons/cargo/functions/fnc_paradropItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,26 @@ if (_item isEqualType objNull) then {

// Create smoke effect when crate landed
[{
(_this select 0) params ["_object"];
params ["_object", "_pfhID"];

if (isNull _object) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
_pfhID call CBA_fnc_removePerFrameHandler;
};

if (getPos _object select 2 < 1) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
_pfhID call CBA_fnc_removePerFrameHandler;

// Reenable UAV crew
private _UAVCrew = _object getVariable [QGVAR(isUAV), []];

if (_UAVCrew isNotEqualTo []) then {
// Reenable AI
{
[_x, false] call EFUNC(common,disableAiUAV);
} forEach _UAVCrew;

_object setVariable [QGVAR(isUAV), nil, true];
};

if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then {
private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0];
Expand Down

0 comments on commit 04138d3

Please sign in to comment.