2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2023-07-22 06:41:20 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Unlocks the seat of an unconscious or dead unit after getting moved out or waking up.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_unit"];
|
|
|
|
|
|
|
|
private _seat = _unit getVariable [QGVAR(lockedSeat), []];
|
|
|
|
_seat params ["_vehicle", "_type", "_position"];
|
|
|
|
|
2023-08-02 05:59:46 +00:00
|
|
|
TRACE_2("unlockUnconsciousSeat",_unit,_seat);
|
2023-07-22 06:41:20 +00:00
|
|
|
if (_seat isEqualTo []) exitWith {};
|
|
|
|
|
|
|
|
switch (_type) do {
|
|
|
|
case "driver": {
|
|
|
|
_vehicle lockDriver false;
|
|
|
|
};
|
|
|
|
|
|
|
|
case "cargo": {
|
|
|
|
_vehicle lockCargo [_position, false];
|
|
|
|
};
|
|
|
|
|
|
|
|
case "turret": {
|
|
|
|
_vehicle lockTurret [_position, false];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
_unit setVariable [QGVAR(lockedSeat), nil, true];
|