ACE3/addons/common/functions/fnc_hasHatch.sqf

36 lines
811 B
Plaintext
Raw Normal View History

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>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
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};
2015-11-17 16:43:07 +00:00
private _config = configFile >> "CfgVehicles" >> typeOf _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