Skip to content

Commit 35c68ab

Browse files
authored
Added comments
1 parent 9886d5e commit 35c68ab

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

addons/goggles/functions/fnc_respiratorConditions.sqf

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1+
#include "..\script_component.hpp"
2+
/*
3+
* Author: JetfireBlack
4+
* Checks if respirator interactions should be shown based on equipment combinations
5+
*
6+
* Arguments:
7+
* 0: mode <STRING>
8+
*
9+
* Return Value:
10+
* Should interaction be shown? <BOOL>
11+
*
12+
* Example:
13+
* ["combo"] call ace_goggles_fnc_respiratorConditions
14+
*
15+
* Public: yes
16+
*/
17+
118
private _unit = ACE_player;
219

320
if (!local _unit) exitWith {false};
421

5-
private _mode = _this;
22+
params ["_mode"];
623

724
private _goggles = goggles _unit;
825
private _backpack = backpackContainer _unit;
926
private _backpackType = backpack _unit;
1027
private _objectTextures = getObjectTextures _backpack;
1128
private _showAction = false;
1229

30+
// Contact DLC respirators
1331
private _allowedGoggles = [
1432
"G_AirPurifyingRespirator_01_F",
1533
"G_AirPurifyingRespirator_01_nofilter_F",
@@ -21,6 +39,7 @@ private _allowedGoggles = [
2139
"G_AirPurifyingRespirator_02_sand_nofilter_F",
2240
"G_RegulatorMask_F"
2341
];
42+
// Contact DLC respirator backpacks
2443
private _allowedBackpacks = [
2544
"B_CombinationUnitRespirator_01_F",
2645
"B_SCBA_01_F"
@@ -29,17 +48,20 @@ private _allowedBackpacks = [
2948
if (isNull _backpack || {!(_backpackType in _allowedBackpacks)}) then {_objectTextures = ["","","","",""]};
3049

3150
switch _mode do {
51+
// only show when appropriate respirator and backpack are worn
3252
case "combo": {
3353
if !(_goggles in _allowedGoggles) exitWith {};
3454
if !(_backpackType in _allowedBackpacks) exitWith {};
3555
if (_objectTextures#1 isNotEqualTo "" || _objectTextures#2 isNotEqualTo "") exitWith {};
3656
_showAction = true;
3757
};
58+
// always show when wearing mask with filters
3859
case "mask": {
3960
if !(_goggles in (_allowedGoggles - ["G_RegulatorMask_F"])) exitWith {};
4061
if (_objectTextures#1 isNotEqualTo "" || _objectTextures#2 isNotEqualTo "") exitWith {};
4162
_showAction = true;
4263
};
64+
// shown only when hose is present regardless of respirator (Arma does not dynamically remove the hose)
4365
case "hose": {
4466
if !(_backpackType in _allowedBackpacks) exitWith {};
4567
if !(_objectTextures#1 isNotEqualTo "" || _objectTextures#2 isNotEqualTo "") exitWith {};

0 commit comments

Comments
 (0)