Skip to content

Commit

Permalink
Fix all issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpas committed Sep 27, 2023
1 parent 104ed5d commit 4bf9606
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion addons/api/fnc_basicMissionSetup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private _addRadios = {
_player setVariable [QGVAR(basicMissionSetup), true, true];

private _cleanRadioList = [];
private _defaultRadio = (call EFUNC(sys_radio,getDefaultRadio)) select 0;
private _defaultRadio = EGVAR(sys_radio,defaultRadio);
if !(_defaultRadio in _defaultRadios) then {
[_player, "ItemRadio"] call EFUNC(sys_core,removeGear);
[_player, _defaultRadio] call EFUNC(sys_core,removeGear);
Expand Down
2 changes: 1 addition & 1 deletion addons/api/fnc_setItemRadioReplacement.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ ACRE_DEPRECATED(QFUNC(setItemRadioReplacement),"2.12","CBA Setting")

params ["_radioType"];

[QEGVAR(sys_radio,defaultRadio), (EGVAR(sys_radio,defaultRadios) select 0) find (toUpperANSI _radioType), 1, "mission"] call CBA_settings_fnc_set;
[QEGVAR(sys_radio,defaultRadio), _radioType, 1, "mission"] call CBA_settings_fnc_set;

true
22 changes: 0 additions & 22 deletions addons/sys_radio/fnc_getDefaultRadio.sqf

This file was deleted.

8 changes: 6 additions & 2 deletions addons/sys_radio/fnc_monitorRadios.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ GVAR(requestingNewId) = false;

LOG("Monitor Inventory Starting");

[{ACRE_DATA_SYNCED && {(!isNil "ACRE_SERVER_INIT")} && {time >= 1}},{
[{
ACRE_DATA_SYNCED &&
{!isNil "ACRE_SERVER_INIT"} &&
{time >= 1}
}, {
[DFUNC(monitorRadiosPFH), 0.25, []] call CBA_fnc_addPerFrameHandler;
},[]] call CBA_fnc_waitUntilAndExecute;
}, []] call CBA_fnc_waitUntilAndExecute;
5 changes: 3 additions & 2 deletions addons/sys_radio/fnc_monitorRadiosPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@ private _currentUniqueItems = [];
private _hasUnique = _radio call EFUNC(sys_radio,isBaseClassRadio);

if (_radio == "ItemRadio") then {
private _defaultRadio = (call FUNC(getDefaultRadio)) select 0;
private _defaultRadio = GVAR(defaultRadio);
if (_defaultRadio != "") then {
// Replace vanilla radio item
_radio = _defaultRadio;
GVAR(requestingNewId) = true;
[acre_player, "ItemRadio", _radio] call EFUNC(sys_core,replaceGear);
["acre_getRadioId", [acre_player, _radio, QGVAR(returnRadioId)]] call CALLSTACK(CBA_fnc_serverEvent);
TRACE_1("Getting ID for", _radio);
TRACE_1("Getting ID for ItemRadio replacement",_radio);
} else {
// Vanilla radio item replacement disabled, simply remove it.
[acre_player, "ItemRadio"] call EFUNC(sys_core,removeGear);
TRACE_1("Removing ItemRadio",_radio);
};
} else {
if (_hasUnique) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/sys_radio/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[
[""] + (GVAR(defaultRadios) select 0),
[localize "str_a3_cfgglasses_none0"] + (GVAR(defaultRadios) select 1),
((GVAR(defaultRadios) select 0) find "ACRE_PRC343") max 0
((GVAR(defaultRadios) select 0) find "ACRE_PRC343") + 1
],
true
] call CBA_fnc_addSetting;

0 comments on commit 4bf9606

Please sign in to comment.