2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 09:04:53 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Whether goggles are visible <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* _visible = [ace_player] call ace_goggles_fnc_isGogglesVisible;
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-18 21:50:45 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
private ["_currentGlasses", "_result", "_unit"];
|
2015-02-02 09:04:53 +00:00
|
|
|
_unit = _this select 0;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_currentGlasses = goggles _unit;
|
|
|
|
_result = false;
|
|
|
|
|
|
|
|
if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")};
|
|
|
|
|
|
|
|
if (_currentGlasses != "") then {
|
2015-04-06 16:22:43 +00:00
|
|
|
_position =(getPosASLW _unit);
|
|
|
|
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
|
|
|
|
_result = ([_currentGlasses] call FUNC(isDivingGoggles));
|
|
|
|
};
|
|
|
|
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
|
|
|
|
_result = false;
|
|
|
|
};
|
|
|
|
_result = !([_currentGlasses] call FUNC(isDivingGoggles));
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
_result
|