2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 09:04:53 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
2015-09-29 15:57:09 +00:00
|
|
|
* Determines if goggles are visible on passed unit.
|
2015-02-02 09:04:53 +00:00
|
|
|
*
|
|
|
|
* 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-04-18 03:40:37 +00:00
|
|
|
|
2015-08-31 13:56:51 +00:00
|
|
|
params ["_unit"];
|
2015-09-29 15:57:09 +00:00
|
|
|
|
|
|
|
private ["_currentGlasses", "_position"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_currentGlasses = goggles _unit;
|
|
|
|
|
2015-09-29 15:57:09 +00:00
|
|
|
if (_currentGlasses == "") exitWith {false};
|
|
|
|
|
|
|
|
// requires ACE_Resistance config entry. Returns false for balaclavas and bandanas.
|
|
|
|
if (getNumber (configFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {false};
|
|
|
|
|
|
|
|
// check if in water and has diving goggles or on land and not diving goggles
|
|
|
|
_position = getPosASLW _unit;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-09-29 15:57:09 +00:00
|
|
|
(surfaceIsWater _position && {_position select 2 < 0.25}) isEqualTo (_currentGlasses call FUNC(isDivingGoggles)) // return
|