Skip to content

Commit 00ea40a

Browse files
authored
Merge pull request #2 from AXEmod/release
Fixed GEAR_KEEP_GOGGLES
2 parents 4f47fad + f4978a9 commit 00ea40a

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

addons/gear/functions/fn_initialize.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ if (isNil "GEAR_DEFAULT_TEAM") then { GEAR_DEFAULT_TEAM = "blufor"; };
2828
if (isNil "GEAR_DEFAULT_ROLE") then { GEAR_DEFAULT_ROLE = "rifle"; };
2929
if (isNil "GEAR_DEFAULT_TYPE") then { GEAR_DEFAULT_TYPE = "0"; };
3030

31-
if (isNil "GEAR_KEEP_GOGGLES") then { GEAR_KEEP_GOGGLES = false; };
31+
if (isNil "GEAR_KEEP_GOGGLES") then { GEAR_KEEP_GOGGLES = true; };
3232

3333
// -------------------------------------------------------------------------------------------------

addons/gear/functions/load/fn_load.sqf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ if (_role isEqualTo "") then { _role = _gear_role; };
5353
if (_type isEqualTo "") then { _type = _gear_type; };
5454
if (_team isEqualTo "") then { _team = _gear_team; };
5555

56+
// -------------------------------------------------------------------------------------------------
57+
// PLAYERS DEFAULT GOGGLES
58+
59+
if (GEAR_KEEP_GOGGLES) then {
60+
if ((goggles _unit) != "") then {
61+
_unit setVariable ["gear_user_goggles", (goggles _unit)];
62+
};
63+
};
64+
5665
// -------------------------------------------------------------------------------------------------
5766

5867
[_unit] call AXE_gear_fnc_removeAll;

addons/gear/functions/load/fn_load_loadout.sqf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ private _data = [] call compile preprocessFileLineNumbers _file;
6060

6161
[5, "'%1' loading gear '%2' (File: %3) - Data: %4", [_unit, _role, _file, _data], "gear"] call AXE_fnc_diagLog;
6262

63-
private _unit_goggles = (goggles _unit);
6463
_unit setUnitLoadout [_data, false];
6564

65+
// -------------------------------------------------------------------------------------------------
66+
// LOAD PLAYERS DEFAULT GOGGLES
67+
6668
if (GEAR_KEEP_GOGGLES) then {
67-
if ((goggles _target) != "") then {
68-
removeGoggles _unit;
69+
private _unit_goggles = _unit getVariable ["gear_user_goggles", ""];
70+
if (_unit_goggles != "") then {
71+
if ((goggles _unit) != "") then {removeGoggles _unit;};
72+
_unit addGoggles _unit_goggles;
73+
_unit setVariable ["gear_user_goggles", nil];
6974
};
70-
_unit addGoggles _unit_goggles;
7175
};
7276

7377
// -------------------------------------------------------------------------------------------------

addons/main/script_version.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define MAJOR 1
22
#define MINOR 2
3-
#define PATCHLVL 0
4-
#define BUILD 128
3+
#define PATCHLVL 1
4+
#define BUILD 131

0 commit comments

Comments
 (0)