Skip to content

Commit

Permalink
Merge pull request #2 from AXEmod/release
Browse files Browse the repository at this point in the history
Fixed GEAR_KEEP_GOGGLES
  • Loading branch information
ojemineh authored Oct 1, 2019
2 parents 4f47fad + f4978a9 commit 00ea40a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion addons/gear/functions/fn_initialize.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ if (isNil "GEAR_DEFAULT_TEAM") then { GEAR_DEFAULT_TEAM = "blufor"; };
if (isNil "GEAR_DEFAULT_ROLE") then { GEAR_DEFAULT_ROLE = "rifle"; };
if (isNil "GEAR_DEFAULT_TYPE") then { GEAR_DEFAULT_TYPE = "0"; };

if (isNil "GEAR_KEEP_GOGGLES") then { GEAR_KEEP_GOGGLES = false; };
if (isNil "GEAR_KEEP_GOGGLES") then { GEAR_KEEP_GOGGLES = true; };

// -------------------------------------------------------------------------------------------------
9 changes: 9 additions & 0 deletions addons/gear/functions/load/fn_load.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ if (_role isEqualTo "") then { _role = _gear_role; };
if (_type isEqualTo "") then { _type = _gear_type; };
if (_team isEqualTo "") then { _team = _gear_team; };

// -------------------------------------------------------------------------------------------------
// PLAYERS DEFAULT GOGGLES

if (GEAR_KEEP_GOGGLES) then {
if ((goggles _unit) != "") then {
_unit setVariable ["gear_user_goggles", (goggles _unit)];
};
};

// -------------------------------------------------------------------------------------------------

[_unit] call AXE_gear_fnc_removeAll;
Expand Down
12 changes: 8 additions & 4 deletions addons/gear/functions/load/fn_load_loadout.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ private _data = [] call compile preprocessFileLineNumbers _file;

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

private _unit_goggles = (goggles _unit);
_unit setUnitLoadout [_data, false];

// -------------------------------------------------------------------------------------------------
// LOAD PLAYERS DEFAULT GOGGLES

if (GEAR_KEEP_GOGGLES) then {
if ((goggles _target) != "") then {
removeGoggles _unit;
private _unit_goggles = _unit getVariable ["gear_user_goggles", ""];
if (_unit_goggles != "") then {
if ((goggles _unit) != "") then {removeGoggles _unit;};
_unit addGoggles _unit_goggles;
_unit setVariable ["gear_user_goggles", nil];
};
_unit addGoggles _unit_goggles;
};

// -------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions addons/main/script_version.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define MAJOR 1
#define MINOR 2
#define PATCHLVL 0
#define BUILD 128
#define PATCHLVL 1
#define BUILD 131

0 comments on commit 00ea40a

Please sign in to comment.