mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
397d77e5b5
The condition to disable the overlay for gunners introduces more problems (and inconsistencies for that matter) than it was worth. Vehicle gunners using camera based weapons should probably consider not wearing a pair of glasses/goggles before doing so.
36 lines
950 B
Plaintext
36 lines
950 B
Plaintext
/*
|
|
* 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
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
private ["_currentGlasses", "_result", "_position", "_visible"];
|
|
|
|
_currentGlasses = goggles _unit;
|
|
_result = false;
|
|
|
|
if (_currentGlasses != "") then {
|
|
_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));
|
|
};
|
|
|
|
_result
|