Skip to content

Commit

Permalink
fixed freq bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AdlerSalbei committed May 7, 2019
1 parent 9c22d1e commit bc0d334
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions addons/zeus/XEH_preClientInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,32 @@ Drop this anywhere. Toggles Blue Force Tracking.<br/>";
["loadout", {
//current units loadout changed, check radios
private _loadout = getUnitLoadout player;
if (((player getVariable [QGVAR(channelSW), -1]) isEqualTo -1) && {!((_loadout select 9 select 2) isEqualTo "")}) then {
[] call FUNC(moduleDiagnosticsGetPlayerFreqsAtStart);
};
if (_loadout isEqualTo []) exitWith {};
private _linkedItems = _loadout select 9;
if !(_linkedItems isEqualTo []) then {
if (((player getVariable [QGVAR(channelSW), -1]) isEqualTo -1) && {!(( _linkedItems select 2) isEqualTo "")}) then {
[] call FUNC(moduleDiagnosticsGetPlayerFreqsAtStart);
};

if (!((player getVariable [QGVAR(channelSW), -1]) isEqualTo -1) && {(_loadout select 9 select 2) isEqualTo ""}) then {
player setVariable [QGVAR(channelSW), nil, true];
player setVariable [QGVAR(freqSW), nil, true];
player setVariable [QGVAR(channelAdditionalSW), nil, true];
player setVariable [QGVAR(freqAdditionalSW), nil, true];
if (!((player getVariable [QGVAR(channelSW), -1]) isEqualTo -1) && {(_linkedItems select 2) isEqualTo ""}) then {
player setVariable [QGVAR(channelSW), nil, true];
player setVariable [QGVAR(freqSW), nil, true];
player setVariable [QGVAR(channelAdditionalSW), nil, true];
player setVariable [QGVAR(freqAdditionalSW), nil, true];
};
};

if (((player getVariable [QGVAR(channelLR), -1]) isEqualTo -1) && {!((_loadout select 5 select 0) isEqualTo "")}) then {
[] call FUNC(moduleDiagnosticsGetPlayerFreqsAtStart);
};
private _backpack = _loadout select 5;
if !(_backpack isEqualTo []) then {
if (((player getVariable [QGVAR(channelLR), -1]) isEqualTo -1) && {!((_backpack select 0) isEqualTo "")}) then {
[] call FUNC(moduleDiagnosticsGetPlayerFreqsAtStart);
};

if (!((player getVariable [QGVAR(channelLR), -1]) isEqualTo -1) && {(_loadout select 5 select 0) isEqualTo ""}) then {
player setVariable [QGVAR(channelLR), nil, true];
player setVariable [QGVAR(freqLR), nil, true];
player setVariable [QGVAR(channelAdditionalLR), nil, true];
player setVariable [QGVAR(freqAdditionalLR), nil, true];
if (!((player getVariable [QGVAR(channelLR), -1]) isEqualTo -1) && {(_backpack select 0) isEqualTo ""}) then {
player setVariable [QGVAR(channelLR), nil, true];
player setVariable [QGVAR(freqLR), nil, true];
player setVariable [QGVAR(channelAdditionalLR), nil, true];
player setVariable [QGVAR(freqAdditionalLR), nil, true];
};
};
}, true] call CBA_fnc_addPlayerEventHandler;

0 comments on commit bc0d334

Please sign in to comment.