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

Core - Fix Fast Channel Switch of VRC-64 #1357

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions addons/api/fnc_getRadioChannel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ if !(_radioId isEqualType "") exitWith { -1 };
private _channelNumber = [_radioId, "getCurrentChannel"] call EFUNC(sys_data,dataEvent);

if (isNil "_channelNumber") exitWith { -1 };

private _radioType = [_radioId] call EFUNC(sys_radio,getRadioBaseClassname);

if (_radioType == "ACRE_PRC77") exitWith { _channelNumber };

_channelNumber + 1
7 changes: 4 additions & 3 deletions addons/api/fnc_setRadioChannel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ params [
if !(_radioId isEqualType "") exitWith { false };

if (_channelNumber isEqualType 0) then {
private _eventData = _channelNumber - 1;
if (([_radioId] call FUNC(getBaseRadio)) == "ACRE_PRC77") then {
_eventData = [_eventData, 0]; // ACRE_PRC77 expects an array of [mhzKnob, khzKnob]
private _eventData = if (([_radioId] call FUNC(getBaseRadio)) == "ACRE_PRC77") then {
[_channelNumber, 0] // ACRE_PRC77 expects an array of [mhzKnob, khzKnob]
mrschick marked this conversation as resolved.
Show resolved Hide resolved
} else {
_channelNumber - 1
mrschick marked this conversation as resolved.
Show resolved Hide resolved
};
[_radioId, "setCurrentChannel", _eventData] call EFUNC(sys_data,dataEvent);
} else {
Expand Down
9 changes: 9 additions & 0 deletions addons/sys_core/fnc_switchChannelFast.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ if (_isManpack == 0 || {_isRackRadio}) then {
case "ACRE_PRC152": {
_channel = (_channel + _dir) min 5;
};
case "ACRE_PRC77": {
_channel = (_channel select 0) + _dir;
if (_channel > 22) then {
_channel = 0;
};
if (_channel < 0) then {
_channel = 22;
};
};
default {
_channel = _channel + _dir;
};
Expand Down
4 changes: 1 addition & 3 deletions addons/sys_prc77/radio/fnc_getCurrentChannel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ TRACE_1("GET CURRENT CHANNEL",_this);

params ["", "", "", "_radioData", ""];

private _return = 0;

_return
HASH_GET(_radioData,"currentChannel")
Loading