diff --git a/addons/gear/functions/fn_initialize.sqf b/addons/gear/functions/fn_initialize.sqf index 5466809..3ddf798 100644 --- a/addons/gear/functions/fn_initialize.sqf +++ b/addons/gear/functions/fn_initialize.sqf @@ -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; }; // ------------------------------------------------------------------------------------------------- diff --git a/addons/gear/functions/load/fn_load.sqf b/addons/gear/functions/load/fn_load.sqf index b272b90..85bc3f9 100644 --- a/addons/gear/functions/load/fn_load.sqf +++ b/addons/gear/functions/load/fn_load.sqf @@ -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; diff --git a/addons/gear/functions/load/fn_load_loadout.sqf b/addons/gear/functions/load/fn_load_loadout.sqf index f81a834..bfa4321 100644 --- a/addons/gear/functions/load/fn_load_loadout.sqf +++ b/addons/gear/functions/load/fn_load_loadout.sqf @@ -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; }; // ------------------------------------------------------------------------------------------------- diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 20ebc0e..420953e 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 1 #define MINOR 2 -#define PATCHLVL 0 -#define BUILD 128 +#define PATCHLVL 1 +#define BUILD 131