Cargo - Reenable UAV AI when on ground when paradropped (#10137)

Reenable UAV AI when on ground when paradropped
This commit is contained in:
johnb432 2024-07-22 19:15:43 +02:00 committed by GitHub
parent b6e9cabc34
commit db339ab8e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,14 +100,26 @@ if (_item isEqualType objNull) then {
// Create smoke effect when crate landed // Create smoke effect when crate landed
[{ [{
(_this select 0) params ["_object"]; params ["_object", "_pfhID"];
if (isNull _object) exitWith { if (isNull _object) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler; _pfhID call CBA_fnc_removePerFrameHandler;
}; };
if (getPos _object select 2 < 1) exitWith { 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 { if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then {
private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0]; private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0];