From b48df4638f431bf7d59479062c20b1f0dfadba93 Mon Sep 17 00:00:00 2001 From: Drofseh Date: Sat, 12 Oct 2024 22:21:25 -0700 Subject: [PATCH 1/3] stop assuming 'r' exists as a default loadout --- addons/assigngear/functions/fnc_assignGear.sqf | 4 +++- addons/assigngear/functions/fnc_loadAssignGear.sqf | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/assigngear/functions/fnc_assignGear.sqf b/addons/assigngear/functions/fnc_assignGear.sqf index 7b36fb0..5b17c89 100644 --- a/addons/assigngear/functions/fnc_assignGear.sqf +++ b/addons/assigngear/functions/fnc_assignGear.sqf @@ -22,9 +22,11 @@ if !(local _unit) exitWith {}; _this params [ "", ["_faction", _unit getVariable [QGVAR(faction), toLower faction _unit]], - ["_role", _unit getVariable [QGVAR(role), "r"]] + ["_role", _unit getVariable [QGVAR(role), ""]] ]; +if (_role == "") exitWith {TRACE_2("No role assigned",_unit,_faction)}; + // Sometimes in editor this function is run before preInit, this should make sure that the namespace exists private _namespace = missionNamespace getVariable QGVAR(namespace); ISNILS(_namespace,[FUNC(initNamespace)] call CBA_fnc_directCall); diff --git a/addons/assigngear/functions/fnc_loadAssignGear.sqf b/addons/assigngear/functions/fnc_loadAssignGear.sqf index d6c7942..18f3194 100644 --- a/addons/assigngear/functions/fnc_loadAssignGear.sqf +++ b/addons/assigngear/functions/fnc_loadAssignGear.sqf @@ -14,6 +14,7 @@ * Description: * Loads assigngear from config */ + #define CFGROLE (_cfg >> "CfgLoadouts" >> _faction >> _role) #define CFGPARSE (configFile >> "CfgLoadoutsParser") @@ -39,7 +40,7 @@ private _loadoutArray = []; // Create an array where each index is tied to a specific type of item #define CASE(_type,_index) case _type: {_loadoutArray set [_index, _x call BIS_fnc_getCfgData]} -; // Travis doesn't like defines without ; + { switch (toLower configName _x) do { // Equipment/appearance From b0f2996400b33448040017d4911b121e1f399cca Mon Sep 17 00:00:00 2001 From: Drofseh Date: Sat, 12 Oct 2024 23:23:51 -0700 Subject: [PATCH 2/3] Update fnc_AIGearEH.sqf --- addons/assigngear/functions/fnc_AIGearEH.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/assigngear/functions/fnc_AIGearEH.sqf b/addons/assigngear/functions/fnc_AIGearEH.sqf index 0825627..f98d509 100644 --- a/addons/assigngear/functions/fnc_AIGearEH.sqf +++ b/addons/assigngear/functions/fnc_AIGearEH.sqf @@ -40,7 +40,7 @@ if !( isClass (missionConfigFile >> "CfgLoadouts" >> _loadout >> _role) || isClass (configFile >> "CfgLoadouts" >> _loadout >> _role) ) then { - ERROR_2("AIGear: ""%1"" not present in ""%2"", reverting to default ""r""",_role,_loadout); + ERROR_2("AIGear: ""%1"" not present in ""%2"", attempting to revert to ""r"" loadout.",_role,_loadout); _role = "r"; }; From 1812cf355fdb6cab5060f174a33788f9e3fbf79e Mon Sep 17 00:00:00 2001 From: Drofseh Date: Sun, 17 Nov 2024 22:20:25 -0800 Subject: [PATCH 3/3] replace "r" with "baseman" --- addons/assigngear/functions/fnc_AIGearEH.sqf | 4 ++-- addons/assigngear/functions/fnc_assignGear.sqf | 4 ++-- addons/assigngear/functions/fnc_gui_gearSelector_init.sqf | 2 +- addons/assigngear/functions/fnc_testGear.sqf | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/assigngear/functions/fnc_AIGearEH.sqf b/addons/assigngear/functions/fnc_AIGearEH.sqf index f98d509..48f6f71 100644 --- a/addons/assigngear/functions/fnc_AIGearEH.sqf +++ b/addons/assigngear/functions/fnc_AIGearEH.sqf @@ -40,8 +40,8 @@ if !( isClass (missionConfigFile >> "CfgLoadouts" >> _loadout >> _role) || isClass (configFile >> "CfgLoadouts" >> _loadout >> _role) ) then { - ERROR_2("AIGear: ""%1"" not present in ""%2"", attempting to revert to ""r"" loadout.",_role,_loadout); - _role = "r"; + ERROR_2("AIGear: ""%1"" not present in ""%2"", attempting to revert to ""baseMan"" loadout.",_role,_loadout); + _role = "baseMan"; }; [_unit,_loadout,_role] call FUNC(assignGear); diff --git a/addons/assigngear/functions/fnc_assignGear.sqf b/addons/assigngear/functions/fnc_assignGear.sqf index 5b17c89..560f5ca 100644 --- a/addons/assigngear/functions/fnc_assignGear.sqf +++ b/addons/assigngear/functions/fnc_assignGear.sqf @@ -150,8 +150,8 @@ _unit setUnitLoadout (configFile >> 'EmptyLoadout'); }; } forEach _loadoutArray; -_unit setVariable [QGVAR(faction), _faction,true]; -_unit setVariable [QGVAR(role), _role,true]; +_unit setVariable [QGVAR(faction), _faction, true]; +_unit setVariable [QGVAR(role), _role, true]; LOG_3("Assigned loadout to unit",_unit,_faction,_loadout); diff --git a/addons/assigngear/functions/fnc_gui_gearSelector_init.sqf b/addons/assigngear/functions/fnc_gui_gearSelector_init.sqf index 62a58f3..f366d06 100644 --- a/addons/assigngear/functions/fnc_gui_gearSelector_init.sqf +++ b/addons/assigngear/functions/fnc_gui_gearSelector_init.sqf @@ -3,7 +3,7 @@ disableSerialization; params ["_display"]; -private _playerRole = CURUNIT getVariable [QGVAR(role), "r"]; +private _playerRole = CURUNIT getVariable [QGVAR(role), "baseman"]; private _playerFaction = CURUNIT getVariable [QGVAR(faction), faction CURUNIT]; if !(isClass (missionConfigFile >> "CfgLoadouts" >> _playerFaction) || isClass (configFile >> "CfgLoadouts" >> _playerFaction)) then { diff --git a/addons/assigngear/functions/fnc_testGear.sqf b/addons/assigngear/functions/fnc_testGear.sqf index 270fa02..ebb709f 100644 --- a/addons/assigngear/functions/fnc_testGear.sqf +++ b/addons/assigngear/functions/fnc_testGear.sqf @@ -37,7 +37,7 @@ private _fnc_checkExists_insignia = { }; private _fncTestUnit = { - params ["_faction",["_role","r"]]; + params ["_faction",["_role","baseman"]]; private _cfg = missionConfigFile >> "cfgLoadouts" >> _faction >> _role; if (!isClass (_cfg)) then { @@ -237,7 +237,7 @@ private _loadoutFreespace = []; (_unit get3DENAttribute 'TMF_assignGear_enabled') params [["_enabled",false]]; if (_enabled) then { - (_unit get3DENAttribute 'TMF_assignGear_role') params [["_role","r"]]; + (_unit get3DENAttribute 'TMF_assignGear_role') params [["_role","baseman"]]; (_unit get3DENAttribute 'TMF_assignGear_faction') params [["_faction",toLower(faction _unit)]]; private _index = _loadoutsTested pushBackUnique [_faction, _role];