Skip to content
2 changes: 1 addition & 1 deletion addons/adminmenu/functions/fnc_modal_assignGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ _ctrlButton ctrlAddEventHandler ["ButtonClick", {
if (cbChecked _x || {_playerRole == ""}) then {
_playerRole = _ctrlComboRole lbData (lbCurSel _ctrlComboRole);
if (_playerRole == "") then {
_playerRole = "r";
_playerRole = "baseMan";
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private _tickCheckbox = false;

private _playerRole = toLower (_player getVariable [QEGVAR(assigngear,role), ""]);
if (_playerRole == "" || {!(_playerRole in _rolesSimple)}) then {
_playerRole = "r";
_playerRole = "baseMan";
_tickCheckbox = true;
};

Expand Down
4 changes: 2 additions & 2 deletions addons/assigngear/functions/fnc_AIGearEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 5 additions & 3 deletions addons/assigngear/functions/fnc_assignGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion addons/assigngear/functions/fnc_gui_gearSelector_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion addons/assigngear/functions/fnc_initAIGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ if (_hash isEqualTo []) then {
};
// Fallback if no default defined
if (_default isEqualTo []) then {
_default = ["r",1];
_default = ["baseMan",1];
};

_hash = createHashMap;
Expand Down
3 changes: 2 additions & 1 deletion addons/assigngear/functions/fnc_loadAssignGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* Description:
* Loads assigngear from config
*/

#define CFGROLE (_cfg >> "CfgLoadouts" >> _faction >> _role)
#define CFGPARSE (configFile >> "CfgLoadoutsParser")

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions addons/assigngear/functions/fnc_testGear.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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];
Expand Down