From b70aafa876315a965a37ebb06970e7d860632119 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:29:39 +0200 Subject: [PATCH] Update fnc_unload.sqf --- addons/cargo/functions/fnc_unload.sqf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/cargo/functions/fnc_unload.sqf b/addons/cargo/functions/fnc_unload.sqf index 71b48df23f..0104ee4940 100644 --- a/addons/cargo/functions/fnc_unload.sqf +++ b/addons/cargo/functions/fnc_unload.sqf @@ -52,6 +52,18 @@ if (_object isEqualType objNull) then { [QEGVAR(zeus,addObjects), [[_object], _objectCurators]] call CBA_fnc_serverEvent; }; + // 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]; + }; + private _cargoNet = _object getVariable [QGVAR(cargoNet), objNull]; // Delete cargo net if no items remain on it