mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
81e02a7336
* Everything * Fixed missing ; * Fix missing ; and double private * Fixed cannot isNull on number * Turn _temparture back to isNil * Fix error from merge
31 lines
855 B
Plaintext
31 lines
855 B
Plaintext
/*
|
|
* Author: Garth 'L-H' de Wet
|
|
* Determines if goggles are visible on passed unit.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Whether goggles are visible <BOOL>
|
|
*
|
|
* Example:
|
|
* _visible = [ace_player] call ace_goggles_fnc_isGogglesVisible;
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
|
|
private _currentGlasses = goggles _unit;
|
|
|
|
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
|
|
private _position = getPosASLW _unit;
|
|
|
|
(surfaceIsWater _position && {_position select 2 < 0.25}) isEqualTo (_currentGlasses call FUNC(isDivingGoggles)) // return
|