2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-18 21:50:45 +00:00
|
|
|
fnc_isGogglesVisible.sqf
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Author: Garth de Wet (LH)
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Description:
|
|
|
|
Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER)
|
2015-01-18 21:50:45 +00:00
|
|
|
|
|
|
|
Parameters:
|
2015-01-11 16:42:31 +00:00
|
|
|
0: Object - unit to check for visible goggles
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Returns:
|
|
|
|
BOOL - Whether the goggles are visible or not.
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Example:
|
2015-01-18 21:50:45 +00:00
|
|
|
_visible = ace_player call FUNC(isGogglesVisible);
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-18 21:50:45 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
private ["_currentGlasses", "_result", "_unit"];
|
|
|
|
_unit = _this;
|
|
|
|
|
|
|
|
_currentGlasses = goggles _unit;
|
|
|
|
_result = false;
|
|
|
|
|
|
|
|
if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")};
|
|
|
|
|
|
|
|
if (_currentGlasses != "") then {
|
|
|
|
_position =(getPosASLW _unit);
|
|
|
|
if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith {
|
2015-01-18 21:50:45 +00:00
|
|
|
_result = (_currentGlasses call FUNC(isDivingGoggles));
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
2015-01-18 19:43:51 +00:00
|
|
|
if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith {
|
2015-01-11 16:42:31 +00:00
|
|
|
_result = false;
|
|
|
|
};
|
2015-01-18 21:50:45 +00:00
|
|
|
_result = !(_currentGlasses call FUNC(isDivingGoggles));
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
_result
|