Skip to content

Commit

Permalink
Merge pull request #806 from AndreasBrostrom/acre-checks
Browse files Browse the repository at this point in the history
Radio functions dont run when acre is not enabled or pressent
  • Loading branch information
AndreasBrostrom authored Oct 27, 2021
2 parents ac98545 + 85eeecf commit e1ad064
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cScripts/functions/gear/fn_gear_setupRadios.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
* [] call cScripts_fnc_gear_setupRadios
*
*/


if !(EGVAR(patches,usesACRE)) exitWith {};
if !(EGVAR(Settings,enableACRE)) exitWith {};
if (count allMissionObjects "acre_api_basicMissionSetup" > 0) exitWith {};
if (count allMissionObjects "acre_api_nameChannels" > 0) exitWith {};

Expand Down
4 changes: 3 additions & 1 deletion cScripts/functions/players/fn_setRadioChannel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

params [["_player", objNull, [objNull]]];

if !(isPlayer _player) exitWith {};
if !(EGVAR(patches,usesACRE)) exitWith {};
if !(EGVAR(Settings,enableACRE)) exitWith {};
if !(isPlayer player) exitWith {};

_player setVariable [QEGVAR(Player,RadioChannel), []];
private _playerRadios = [_player] call acre_api_fnc_getCurrentRadioList;
Expand Down
10 changes: 4 additions & 6 deletions init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ if (!isMultiplayer) then {["Mission is running on singelplayer enviroment!", "",

// ACRE radio init
if (isMultiplayer) then {
if (EGVAR(patches,usesACRE) && EGVAR(Settings,enableACRE)) then {
GVAR(Radio) = false;
["Setting up ACRE preset...", "init"] call FUNC(info);
call EFUNC(gear,setupRadios);
GVAR(Radio) = true;
};
GVAR(Radio) = false;
["Setting up ACRE preset...", "init"] call FUNC(info);
call EFUNC(gear,setupRadios);
GVAR(Radio) = true;
} else {
["Mission in singelplayer enviroment ACRE radio preset will not be set!", "init", true] call FUNC(warning);
};
Expand Down

0 comments on commit e1ad064

Please sign in to comment.