ACE3/addons/common/functions/fnc_hasHatch.sqf

39 lines
857 B
Plaintext
Raw Normal View History

#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>
*
* Example:
* [bob] call ace_common_fnc_hasHatch
*
2015-10-28 07:01:25 +00:00
* Public: Yes
*/
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};
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