diff --git a/addons/assigngear/functions/fnc_AIGearEH.sqf b/addons/assigngear/functions/fnc_AIGearEH.sqf index 0825627..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"", reverting to default ""r""",_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 7b36fb0..560f5ca 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); @@ -148,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_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 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];