From c44360bd19bafc773324df1b082aac3904268144 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 19 Feb 2020 10:05:05 -0600 Subject: [PATCH] Medical - Unlock air controls when going uncon (#7533) * Medical - Unlock air controlls when going uncon * remove unneeded parentheses * Update addons/medical_status/functions/fnc_setUnconsciousState.sqf Co-Authored-By: mharis001 <34453221+mharis001@users.noreply.github.com> Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com> --- addons/medical_status/functions/fnc_setUnconsciousState.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/medical_status/functions/fnc_setUnconsciousState.sqf b/addons/medical_status/functions/fnc_setUnconsciousState.sqf index 88a37927d91..715041d7015 100644 --- a/addons/medical_status/functions/fnc_setUnconsciousState.sqf +++ b/addons/medical_status/functions/fnc_setUnconsciousState.sqf @@ -46,6 +46,12 @@ if (_active) then { closeDialog 0; }; }; + // Unlock controls for copilot if unit is pilot of aircraft + if (vehicle _unit isKindOf "Air" && {_unit == driver vehicle _unit}) then { + TRACE_1("pilot of air vehicle - unlocking controls",vehicle _unit); + // Do "Unlock controls" user action, co-pilot will then have to do the "Take Controls" actions + _unit action ["UnlockVehicleControl", vehicle _unit]; + }; } else { // Unit has woken up, no longer need to track this _unit setVariable [QEGVAR(medical,lastWakeUpCheck), nil];