Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Racks - Fix vehicle racks unable to use certain intercoms #1255

Merged
merged 3 commits into from
Aug 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions addons/sys_rack/fnc_configWiredIntercoms.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* 1: Rack class <STRING>
*
* Return Value:
* None
* Wired Intercoms <ARRAY>
*
* Example:
* [cursorTarget] call acre_sys_rack_configWiredIntercoms
Expand All @@ -25,18 +25,18 @@ private _wiredIntercoms = [];
if (_intercoms isEqualTo [] || {"none" in _intercoms}) then {
_wiredIntercoms = [];
} else {
private _configuredIntercoms = _vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []];
if ("all" in _intercoms) then {
{
_wiredIntercoms pushBack (_x select 0);
} forEach (_vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []]);
} forEach _configuredIntercoms;
} else {
private _intercomIds = _configuredIntercoms apply {_x select 0};
{
private _int = _x;
private _configuredIntercoms = _vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []];
if (_int in (_configuredIntercoms select 0)) then {
if (_x in _intercomIds) then {
_wiredIntercoms pushBack _x;
} else {
WARNING_3("No intercom %1 defined but rack %2 can have access to its network for %3 - skipping",_int,_rack,typeOf _vehicle)
WARNING_3("No intercom %1 defined but rack %2 can have access to its network for %3 - skipping",_x,_rack,typeOf _vehicle)
};
} forEach _intercoms;
};
Expand Down