Skip to content

Commit

Permalink
Make unit filters for factions more specfic to exclude some units
Browse files Browse the repository at this point in the history
  • Loading branch information
theace0296 committed Oct 28, 2021
1 parent 3d9b764 commit 10baf5f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions RandFramework/Global/factions/fn_getUnitDataByFaction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ private _units = [];

{
// We are using "icon" instead of "role" because the icon is better for determining unit role, since, for example, RHS doesn't correctly label the unit role.
// Also, discard VR, Unarmed, and Survivor units
if (getText(_x >> "icon") != "iconManVirtual" && {!(["VR ", getText(_x >> "displayName"), true] call BIS_fnc_inString) && {!(["unarmed", getText(_x >> "displayName")] call BIS_fnc_inString) && {!(["survivor", getText(_x >> "displayName")] call BIS_fnc_inString)}}}) then {
// Also, discard VR, Unarmed, and Survivor units (Using vr[space] seems to catch the vr units correctly)
private _badNames = ["vr ", "unarmed", "survivor", "story", "competitor", "parade dress"];
private _displayName = getText(_x >> "displayName");
private _fnc_displayNameOkay = { {[_x, _displayName] call BIS_fnc_inString} count _badNames isEqualTo 0 };
if (getText(_x >> "icon") != "iconManVirtual" && { call _fnc_displayNameOkay }) then {
_units pushBack [(configname _x), getText(_x >> "displayName"), getText(_x >> "icon"), getText(_x >> "textSingular"), getNumber(_x >> "attendant"), getNumber(_x >> "engineer"), getNumber(_x >> "canDeactivateMines"), getNumber(_x >> "uavHacker")];
};
} forEach _unitConfigPaths;
Expand Down
2 changes: 1 addition & 1 deletion RandFramework/Global/init/fn_initGlobalVars.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if (TRGM_Var_iTimeMultiplier isEqualTo 50) then {
publicVariable "TRGM_VAR_iTimeMultiplier";

if (isNil "TRGM_VAR_SaveDataVersion") then { TRGM_VAR_SaveDataVersion = 3; publicVariable "TRGM_VAR_SaveDataVersion"; };
if (isNil "TRGM_VAR_FactionVersion") then { TRGM_VAR_FactionVersion = 4; publicVariable "TRGM_VAR_FactionVersion"; };
if (isNil "TRGM_VAR_FactionVersion") then { TRGM_VAR_FactionVersion = 5; publicVariable "TRGM_VAR_FactionVersion"; };
if (isNil "TRGM_VAR_LocationVersion") then { TRGM_VAR_LocationVersion = 3; publicVariable "TRGM_VAR_LocationVersion"; };

//// These must be declared BEFORE either initUnitVars or CUSTOM_MISSION_fnc_SetDefaultMissionSetupVars!!!
Expand Down

0 comments on commit 10baf5f

Please sign in to comment.