From 49fbeb6fe7e3dad408fdcf4fe58b5ef767cf61e9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 17 Jul 2024 19:59:11 -0500 Subject: [PATCH] Medical Engine - Allow disabling seat locking on vehicle types --- .../medical_engine/functions/fnc_lockUnconsciousSeat.sqf | 8 +++++++- docs/wiki/framework/medical-framework.md | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf index cc29e75cc1a..8441df4ad83 100644 --- a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf +++ b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf @@ -11,7 +11,6 @@ * * Public: No */ -if (missionNamespace getVariable [QGVAR(disableSeatLocking), false]) exitWith {}; params ["_unit"]; private _vehicle = objectParent _unit; @@ -20,6 +19,13 @@ TRACE_3("lockUnconsciousSeat",_unit,_vehicle,lifeState _unit); if (isNull _vehicle) exitWith {}; if (alive _unit && {lifeState _unit != "INCAPACITATED"}) exitWith {}; +private _disable = missionNamespace getVariable [QGVAR(disableSeatLocking), false]; +if (_disable isEqualTo true || { + _disable isEqualType [] && { + (_disable findIf {_vehicle isKindOf _x}) != -1 + } +}) exitWith {}; + switch (true) do { case (_unit isEqualTo (driver _vehicle)): { _vehicle lockDriver true; diff --git a/docs/wiki/framework/medical-framework.md b/docs/wiki/framework/medical-framework.md index 00d9133b004..c0e94b5f9ee 100644 --- a/docs/wiki/framework/medical-framework.md +++ b/docs/wiki/framework/medical-framework.md @@ -241,3 +241,10 @@ The damage elements are sorted in descending order according to how much damage Some of ACE Medical's underlying behavior, primarily related to damage handling and the vitals loop, can be fine-tuned by editing `ace_medical_const_` variables, found in [script_macros_medical.hpp](https://github.com/acemod/ACE3/blob/master/addons/medical_engine/script_macros_medical.hpp). Modification of those values should be done by advanced users only. Values and variable names are subject to change without prior warning. Modifying values mid-mission may lead to undefined behavior. Expect minimal support. + +### 5.1 Disable seat locking for unconscious +ACE will lock the seat of an unconscious or dead unit to prevent automatic unloading. This can be disabled by setting: +```sqf +ace_medical_engine_disableSeatLocking = true; // disable on everything +ace_medical_engine_disableSeatLocking = ["ship"]; // disable just on boats +```