2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-10-28 07:01:25 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
2015-10-28 18:02:54 +00:00
|
|
|
* Check if unit is in a vehicle position where it can turn in or out.
|
2015-10-28 07:01:25 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Unit has a hatch? <BOOL>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob] call ace_common_fnc_hasHatch
|
|
|
|
*
|
2015-10-28 07:01:25 +00:00
|
|
|
* Public: Yes
|
|
|
|
*/
|
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
params [["_unit", objNull, [objNull]]];
|
2015-10-28 07:01:25 +00:00
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _vehicle = vehicle _unit;
|
2015-10-28 07:01:25 +00:00
|
|
|
|
|
|
|
if (_unit == _vehicle) exitWith {false};
|
|
|
|
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _vehicle;
|
2015-10-28 07:01:25 +00:00
|
|
|
|
|
|
|
if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false};
|
|
|
|
|
|
|
|
if (_unit == driver _vehicle) exitWith {
|
|
|
|
getNumber (_config >> "forceHideDriver") == 0; // return
|
|
|
|
};
|
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _turret = [_unit] call FUNC(getTurretIndex);
|
2015-10-28 07:01:25 +00:00
|
|
|
|
|
|
|
if (_turret isEqualTo []) exitWith {false};
|
|
|
|
|
2015-11-17 16:43:07 +00:00
|
|
|
private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
2015-10-28 07:01:25 +00:00
|
|
|
|
|
|
|
getNumber (_turretConfig >> "forceHideGunner") == 0; // return
|