Skip to content

Commit

Permalink
case insensitive intercom configuration (#614)
Browse files Browse the repository at this point in the history
* case  insensitive  intercom configuration

* Better private
  • Loading branch information
TheMagnetar committed Dec 2, 2018
1 parent 0bcde60 commit 8785dc0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addons/sys_rack/fnc_configWiredIntercoms.sqf
Expand Up @@ -20,7 +20,7 @@ params ["_vehicle", "_rack"];

private _type = typeOf _vehicle;

private _intercoms = getArray (_rack >> "intercom");
private _intercoms = (getArray (_rack >> "intercom")) apply {toLower _x};
private _wiredIntercoms = [];

// Set by default to have access to all intercom networks if none was specified
Expand All @@ -33,7 +33,7 @@ if (_intercoms isEqualTo [] || {"none" in _intercoms}) then {
} forEach (_vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []]);
} else {
{
private _int = toLower _x;
private _int = _x;
private _configuredIntercoms = _vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []];
if (_int in (_configuredIntercoms select 0)) then {
_wiredIntercoms pushBack _x;
Expand Down
2 changes: 1 addition & 1 deletion addons/sys_rack/fnc_isRackHearable.sqf
Expand Up @@ -33,7 +33,7 @@ private _wiredIntercoms = [_rackId] call FUNC(getWiredIntercoms);
private _isHearable = false;
{
private _intercomName = _x select 0;
_isHearable = [_vehicle, _unit, _forEachIndex] call EFUNC(sys_intercom,isInIntercom) && (_intercomName in _wiredIntercoms);
_isHearable = [_vehicle, _unit, _forEachIndex] call EFUNC(sys_intercom,isInIntercom) && {_intercomName in _wiredIntercoms};
if (_isHearable) exitWith{};
} forEach (_vehicle getVariable [QEGVAR(sys_intercom,intercomNames), []]);

Expand Down

0 comments on commit 8785dc0

Please sign in to comment.